BASE . LOG, 'log_file_id' => $LOG_FILE_ID, 'log_per_date' => true, ]); $_image = new CoreLibs\Output\Image(); $image_class = 'CoreLibs\Output\Image'; // define a list of from to color sets for conversion test $PAGE_NAME = 'TEST CLASS: IMAGE'; print ""; print "" . $PAGE_NAME . ""; print ""; print '
Class Test Master
'; print '

' . $PAGE_NAME . '

'; // thumb sizes $thumb_width = 250; $thumb_height = 300; // class $image = BASE . CONTENT_PATH . LAYOUT . IMAGES . 'no_picture_square.jpg'; // folders $cache_folder = BASE . CONTENT_PATH . LAYOUT . CACHE . IMAGES; $web_folder = LAYOUT . CACHE . IMAGES; // rotate image first try { $_image->correctImageOrientation($image); } catch (\UnexpectedValueException $e) { print "Message:
" . $e->getMessage() . "
" . $e . "
"; } catch (\RuntimeException $e) { print "Message:
" . $e->getMessage() . "
" . $e . "
"; } // thumbnail tests echo "
CLASS->CREATETHUMBNAILSIMPLE: " . basename($image) . ": WIDTH: $thumb_width
"; // static $image = BASE . CONTENT_PATH . LAYOUT . IMAGES . 'no_picture.jpg'; // rotate image first try { $image_class::correctImageOrientation($image); } catch (\UnexpectedValueException $e) { print "Message:
" . $e->getMessage() . "
" . $e . "
"; } catch (\RuntimeException $e) { print "Message:
" . $e->getMessage() . "
" . $e . "
"; } // thumbnail tests echo "
S::CREATETHUMBNAILSIMPLE: " . basename($image) . ": WIDTH: $thumb_width
"; echo "U-STATIC VARIOUS:
"; // image thumbnail $images = array( // height bigger // 'no_picture.jpg', // 'no_picture.png', // width bigger // 'no_picture_width_bigger.jpg', // 'no_picture_width_bigger.png', // square // 'no_picture_square.jpg', // 'no_picture_square.png', // other sample images // '5c501af48da6c.jpg', // Apple HEIC files // 'img_2145.heic', // Photoshop 'photoshop_test.psd', ); // return mime type ala mimetype $finfo = new finfo(FILEINFO_MIME_TYPE); foreach ($images as $image) { $image = BASE . CONTENT_PATH . LAYOUT . IMAGES . $image; list ($height, $width, $img_type) = \CoreLibs\Convert\SetVarType::setArray(getimagesize($image)); echo "
IMAGE INFO: " . $height . "x" . $width . ", TYPE: " . \CoreLibs\Debug\Support::dumpVar($img_type) . " [" . $finfo->file($image) . "]
"; // rotate image first try { Image::correctImageOrientation($image); } catch (\UnexpectedValueException $e) { print "Message:
" . $e->getMessage() . "
" . $e . "
"; } catch (\RuntimeException $e) { print "Message:
" . $e->getMessage() . "
" . $e . "
"; } // thumbnail tests echo "
" . basename($image) . ": WIDTH: $thumb_width
"; echo "
" . basename($image) . ": HEIGHT: $thumb_height
"; echo "
" . basename($image) . ": WIDTH/HEIGHT: $thumb_width x $thumb_height
"; // test with dummy echo "
" . basename($image) . ": WIDTH/HEIGHT: $thumb_width x $thumb_height (+DUMMY)
"; echo "
"; } // errros try { Image::createThumbnailSimple('', $thumb_width, 0, $cache_folder, $web_folder); } catch (\UnexpectedValueException $e) { print "Message:
" . $e->getMessage() . "
" . $e . "
"; } print ""; // __END__