if ($filecheck['status']) { if (downloadcURL($download['externalLink'], $tempPath . $tempFileName)) { // Worked $imgPath = $tempPath . $tempFileName; } else { die('File download failed!'); } } else { die("File cannot be found at link provided."); } } else { // Do resizing and downloading $imgPath = "{$folderPath}/originals/{$mediaInfo[filename]}"; } try { $mediaImage = new imagetools($imgPath); $mediaImage->setQuality(100); //$mediaImage->setCrop($crop); //$mediaImage->setHCrop($hcrop); $mediaImage->setSize($width); $mediaImage->setWidth($width); $mediaImage->setHeight($height); //$mediaImage->setSharpen($sharpen); $mediaImage->setWatermark($digital['watermark']); $mediaImage->createImage(0, $tmpFilenamePath); } catch (Exception $e) { die(exceptionError($e)); } //$file = "./assets/tmp/{$tmpFilename}"; $ctype = "application/txt"; if (!file_exists($tmpFilenamePath)) {
/* * Convert to global variables */ $size = $_GET['size'] ? $_GET['size'] : '100'; $quality = 90; $memID = $_GET['memID']; $crop = $_GET['crop']; $hcrop = $_GET['hcrop']; $sizeType = 'small'; if ($size > 17 and file_exists(BASE_PATH . "/assets/avatars/{$memID}_large.png")) { // If size setting is larger then 17 use the large size instead $sizeType = 'large'; } $path = BASE_PATH . "/assets/avatars/{$memID}_{$sizeType}.png"; // Direct path to avatar file to use if (!file_exists($path)) { $path = BASE_PATH . '/assets/themes/' . $config['settings']['style'] . '/images/avatar.png'; } if (!file_exists($path)) { $path = BASE_PATH . "/assets/images/blank.png"; } try { $avatar = new imagetools($path); $avatar->setQuality($quality); $avatar->setCrop($crop); $avatar->setHCrop($hcrop); $avatar->setSize($size); $avatar->createImage(1, ''); } catch (Exception $e) { die($e->getMessage()); }
// Not enough memory - use error.png $config['cacheImages'] = 0; // Override caching } } } /* // Testing echo 'path: '.$path.'<br>'; echo 'quality: '.$quality.'<br>'; echo 'crop: '.$crop.'<br>'; echo 'hcrop: '.$hcrop.'<br>'; echo 'sharpen: '.$sharpen.'<br>'; echo 'watermark: '.$watermark.'<br>'; exit; */ $mediaImage = new imagetools($path); $mediaImage->setQuality($quality); $mediaImage->setCrop($crop); $mediaImage->setDebugMode($_SESSION['debugMode'], $plstart); $mediaImage->setHCrop($hcrop); $mediaImage->setSize($size); $mediaImage->setSharpen($sharpen); $mediaImage->setWatermark($watermark); if ($_SESSION['debugMode'] or $config['cacheImages'] == 0 or $offSiteRequest) { $mediaImage->createImage(1, ''); } else { $mediaImage->createImage(1, $cachePathFile); } // Cache //file_get_contents xxxxxxxxxx for reading cached file } catch (Exception $e) {
} else { $memory_limit = $config['DefaultMemory']; } # IF IMAGEMAGICK ALLOW TWEAKED MEMORY LIMIT if (class_exists('Imagick') and $config['settings']['imageproc'] == 2) { $memory_limit = $config['DefaultMemory']; } $autoCreateAvailable = 1; } //test($filenameExt); # CHECK TO SEE IF ONE CAN BE CREATED if (in_array(strtolower($filenameExt), $creatableFiletypes)) { # CHECK THE MEMORY NEEDED TO CREATE IT if ($memory_limit > $mem_needed) { // Create Icon $image = new imagetools($targetDir . $fileName); $image->setSize($config['IconDefaultSize']); $image->setQuality($config['SaveThumbQuality']); $image->createImage(0, $iconImage); // Create Thumb $image->setSize($config['ThumbDefaultSize']); $image->setQuality($config['SaveThumbQuality']); $image->createImage(0, $thumbImage); // Create Sample $image->setSize($config['SampleDefaultSize']); $image->setQuality($config['SaveSampleQuality']); $image->createImage(0, $sampleImage); } else { $errormessage[] = $mgrlang['not_enough_mem']; } }
/* * Convert to global variables */ $size = $_GET['size'] ? $_GET['size'] : '100'; $quality = $config['settings']['thumb_quality']; $sharpen = $config['settings']['thumb_sharpen']; $crop = $_GET['crop']; $hcrop = $_GET['hcrop']; $path = $incomingFolder . "/{$_GET[src]}"; // Direct path to product shot file to use if (!file_exists($path)) { $path = BASE_PATH . "/assets/images/blank.png"; } // echo $path; exit; // Testing try { $contrImage = new imagetools($path); $contrImage->setQuality($quality); $contrImage->setCrop($crop); $contrImage->setHCrop($hcrop); $contrImage->setSize($size); $contrImage->setSharpen($sharpen); //$productShot->createImage(1,''); if ($_SESSION['debugMode'] or $config['cacheImages'] == 0) { $contrImage->createImage(1, ''); } else { $contrImage->createImage(1, $cachePathFile); } // Cache } catch (Exception $e) { die($e->getMessage()); }