} if ($size > $REX['ADDON']['max_size'][$mypage]) { print 'Error size to big: max ' . $REX['ADDON']['max_size'][$mypage] . ' px'; exit; } // start thumb class $thumb = new thumbnail($imagepath); // check method if ($mode == 'w') { $thumb->size_width($size); } if ($mode == 'h') { $thumb->size_height($size); } if ($mode == 'c') { $thumb->size_crop($size, $hmode); } elseif ($hmode != '') { $thumb->size_height($hmode); } if ($mode == 'a') { $thumb->size_auto($size); } foreach ($rex_filter as $filter) { $thumb->addFilter($filter); } // jpeg quality $thumb->jpeg_quality($REX['ADDON']['jpeg_quality'][$mypage]); // save cache $thumb->generateImage($cachepath); exit; }
<?php require_once '../classes/image.class.php'; $size = 150; $image = new thumbnail($_GET['src']); //$image->size_width($size); //Фіксована ширина //$image->size_height($size); //Фіксована висота //$image->size_auto($size); //Фіксована ширина або висота $image->size_crop($size); //Одинакові ширина та висота //$image->size_width_height($size,$size_h); //Довільна ширина та висота //$image->add_logo("watermark.png"); //Додати лого до картинки $image->show();