/** * @Author: ANH DUNG Jan 16, 2015 * @Todo: re resize some small photo not have water mark * @Param: $model model ProListingPhotos */ public static function ResizePhotoListingSmall($model) { // ProListingPhotos::RemovePhotoListingSmall($model); // sleep(1); self::RootImageClone($model); $NewNameImage = self::CopyImageHaveWaterMarkToRoot($model); $ImageProcessing = new ImageProcessing(); $ImageProcessing->folder = "/" . ProListingPhotos::$folderUpload . "/{$model->listing_id}"; // $ImageProcessing->file = ProListingPhotos::SIZE_WATER_MARK."/".$model->image; $ImageProcessing->file = $model->image; $ImageProcessing->thumbs = ProListingPhotos::GetSmallSizeToProcessWaterMark(); $ImageProcessing->create_thumbs(); self::RootImageRestore($model); self::DeleteTempImageClone($model); }
/** * @Author: ANH DUNG Jan 16, 2015 * @Todo: remove small photo to overide photo have water mark * @Param: $model model ProListingPhotos */ public static function RemovePhotoListingSmall($model) { $SmallSize = ProListingPhotos::GetSmallSizeToProcessWaterMark(); foreach ($SmallSize as $k => $v) { @unlink(YII_UPLOAD_DIR . '/listing/' . $model->listing_id . '/' . $k . '/' . $model->image); } }