/** * @Todo: resize lại photo listing if have new size */ public function resizeNewsize($id, $size) { $mFile = ProListingPhotos::model()->findByPk($id); if ($mFile) { $image_find = Yii::getPathOfAlias('webroot') . "/" . ProListingPhotos::$folderUpload . "/" . $mFile->listing_id . "/" . $size . "/" . $mFile->image; if (!file_exists($image_find)) { $sourceImage = Yii::getPathOfAlias('webroot') . "/" . ProListingPhotos::$folderUpload . "/" . $mFile->listing_id . "/" . $mFile->image; if (file_exists($sourceImage)) { Listing::ResizePhotoListing($mFile); Listing::PutWarterMarkPhotoListing($mFile); Listing::ResizePhotoListingSmall($mFile); } } } }
/** * @Author: ANH DUNG Jan 20, 2015 * @Todo: fix resize some photo small not have watermark * @Param: $model * run and done at 11h19 Jan 20, 2015 */ public static function FixWatermarkPhotoSmallSize() { return; $models = self::model()->findAll(); foreach ($models as $mFile) { Listing::PutWarterMarkPhotoListing($mFile); Listing::ResizePhotoListingSmall($mFile); } // $mFile = self::model()->findByPk(3); // Listing::ResizePhotoListingSmall($mFile); echo count($models); die; }