Ejemplo n.º 1
0
 public static function images_getSmallThumbFor($imagePath)
 {
     $fileName = basename($imagePath);
     $dirName = dirname($imagePath);
     if ($dirName) {
         $dirName .= '/';
     }
     $thumbPath = $dirName . self::$options['images']['small_thumb_prefix'] . $fileName;
     if (file_exists($thumbPath)) {
         return $thumbPath;
     } elseif (BertaGallery::createThumbnail($imagePath, $thumbPath, self::$options['images']['small_thumb_width'], self::$options['images']['small_thumb_height'])) {
         return $thumbPath;
     }
     return false;
 }
Ejemplo n.º 2
0
 public static function images_getBgImageFor($imagePath)
 {
     $fileName = basename($imagePath);
     $dirName = dirname($imagePath);
     if ($dirName) {
         $dirName .= '/';
     }
     $bgImagePath = $dirName . self::$options['images']['bg_image_prefix'] . $fileName;
     list($width, $height) = getimagesize($imagePath);
     if (file_exists($bgImagePath)) {
         return $bgImagePath;
     } elseif (BertaGallery::createThumbnail($imagePath, $bgImagePath, $width, $height)) {
         return $bgImagePath;
     }
     return false;
 }