예제 #1
0
</h2>
			<?php 
if ($isEditor) {
    $specManager->setProjVariables($spprid);
    if ($action == 'Process Images') {
        if ($specManager->getProjectType() == 'iplant') {
            $imageProcessor = new ImageProcessor();
            echo '<ul>';
            $imageProcessor->setLogMode(3);
            $imageProcessor->setCollid($collid);
            $imageProcessor->setSpprid($spprid);
            $imageProcessor->processIPlantImages($specManager->getSpecKeyPattern(), $specManager->getLastRunDate());
            echo '</ul>';
        } else {
            echo '<div style="padding:15px;">' . "\n";
            $imageProcessor = new ImageBatchProcessor();
            $imageProcessor->setLogMode(1);
            $imageProcessor->initProcessor();
            $imageProcessor->setCollArr(array($collid => array('pmterm' => $specManager->getSpecKeyPattern())));
            $imageProcessor->setDbMetadata(1);
            $imageProcessor->setSourcePathBase($specManager->getSourcePath());
            $imageProcessor->setTargetPathBase($specManager->getTargetPath());
            $imageProcessor->setImgUrlBase($specManager->getImgUrlBase());
            $imageProcessor->setServerRoot($serverRoot);
            if ($specManager->getWebPixWidth()) {
                $imageProcessor->setWebPixWidth($specManager->getWebPixWidth());
            }
            if ($specManager->getTnPixWidth()) {
                $imageProcessor->setTnPixWidth($specManager->getTnPixWidth());
            }
            if ($specManager->getLgPixWidth()) {
        include_once $serverRoot . '/collections/specprocessor/standalone_scripts/ImageBatchConnectionFactory.php';
    }
    if (file_exists($serverRoot . '/classes/ImageBatchProcessor.php')) {
        require_once $serverRoot . '/classes/ImageBatchProcessor.php';
    }
} else {
    include_once '../../../config/symbini.php';
    if (file_exists('ImageBatchConnectionFactory.php')) {
        include_once 'ImageBatchConnectionFactory.php';
    }
    if (file_exists('ImageBatchProcessor.php')) {
        require_once 'ImageBatchProcessor.php';
    }
}
//-------------------------------------------------------------------------------------------//
$imageProcessor = new ImageBatchProcessor();
//Initiate log file
if (isset($silent) && $silent) {
    $logMode = 2;
}
$imageProcessor->setLogMode($logMode);
if (!$logProcessorPath && $logPath) {
    $logProcessorPath = $logPath;
}
$imageProcessor->setLogPath($logProcessorPath);
$imageProcessor->initProcessor($logTitle);
//Set remaining variables
$imageProcessor->setCollArr($collArr);
$imageProcessor->setDbMetadata($dbMetadata);
$imageProcessor->setSourcePathBase($sourcePathBase);
$imageProcessor->setTargetPathBase($targetPathBase);