diff --git a/util/thumbrepair b/util/thumbrepair new file mode 100755 index 000000000..e13a5f24a --- /dev/null +++ b/util/thumbrepair @@ -0,0 +1,72 @@ +#!/usr/bin/env php + 0", + dbesc($xx['resource_id']) + ); + + foreach($n as $nn) { + + echo $nn['imgscale']; + + $nn['os_path'] = $xx['os_path']; + + switch ($nn['imgscale']) { + case 1: + if($width > 1024 || $height > 1024) + $im->scaleImage(1024); + $im->storeThumbnail($nn, PHOTO_RES_1024); + break; + case 2: + if($width > 640 || $height > 640) + $im->scaleImage(640); + $im->storeThumbnail($nn, PHOTO_RES_640); + break; + case 3: + if($width > 320 || $height > 320) + $im->scaleImage(320); + $im->storeThumbnail($nn, PHOTO_RES_320); + break; + case 4: + $im->storeThumbnail($nn, PHOTO_RES_PROFILE_300); + break; + case 5: + $im->scaleImage(80); + $im->storeThumbnail($nn, PHOTO_RES_PROFILE_80); + break; + case 6: + $im->scaleImage(48); + $im->storeThumbnail($nn, PHOTO_RES_PROFILE_48); + break; + case 7: + $im->storeThumbnail($nn, PHOTO_RES_COVER_1200); + break; + case 8: + $im->doScaleImage(850,310); + $im->storeThumbnail($nn, PHOTO_RES_COVER_850); + break; + case 9: + $im->doScaleImage(425,160); + $im->storeThumbnail($nn, PHOTO_RES_COVER_425); + break; + } + } + } +} +