protected function _createThumbnail($file, $x, $y) { require_once NOLOTIRO_PATH . '/library/SimpleImage.php'; $file_ext = substr(strrchr($file, '.'), 1); $fileuniquename = md5(uniqid(mktime())) . '.' . $file_ext; $image = new SimpleImage(); $image->load('/tmp/' . $file); //save original to right place $widthmax = 900; $heightmax = 1000; $image->resizeToHeightMax($heightmax); $image->resizeToWidthMax($widthmax); $image->save(NOLOTIRO_PATH . '/www/images/uploads/ads/original/' . $fileuniquename); //save thumb $image->resizeToHeight($y); $image->resizeToWidth($x); $image->save(NOLOTIRO_PATH . '/www/images/uploads/ads/100/' . $fileuniquename); return $fileuniquename; }