• R/O
  • SSH
  • HTTPS

jeanscms: コミット


コミットメタ情報

リビジョン309 (tree)
日時2010-11-15 06:05:50
作者kmorimatsu

ログメッセージ

Use table and admin_thumbnail classes for moved methods.

変更サマリ

差分

--- jeanscms/trunk/jeans/plugins/skinfiles/jp_SkinFiles_class.php (revision 308)
+++ jeanscms/trunk/jeans/plugins/skinfiles/jp_SkinFiles_class.php (revision 309)
@@ -284,13 +284,13 @@
284284 media::check_if_changed($time);
285285 // Check if the file is an image.
286286 if (!preg_match('/\.([^\.]+)$/',self::$file,$m)) error::quit('Not an image.');
287- $mime=admin_media::mime($m[1]);
287+ $mime=tables::mime($m[1]);
288288 if (substr($mime,0,6)!='image/') error::quit('Not an image.');
289289 // Get the image info
290290 list($width,$height,$new_width,$new_height)=self::image_size(self::$real_file_path);
291291 // Return the image to browser (use tumbnail if possible.
292292 if ($width!=$new_width || $height!=$new_height) {
293- $gd=admin_media::gd($full_path,$mime);
293+ $gd=admin_thumbnail::gd($full_path,$mime);
294294 if ($gd) $file=$gd[2]['file'];
295295 }
296296 if (!isset($file)) $file=self::local_file_contents(_DIR_SKINS,self::$real_file_path);
@@ -299,9 +299,9 @@
299299 static public function tag_thumbnail(&$data){
300300 $file=$data['name'];
301301 // Check if the file is an image.
302- if (!preg_match('/\.([^\.]+)$/',$file,$m)) return self::p('Not an image.');
303- $mime=admin_media::mime($m[1]);
304- if (substr($mime,0,6)!='image/') return self::p('Not an image.');
302+ if (!preg_match('/\.([^\.]+)$/',$file,$m)) error::quit('Not an image.');
303+ $mime=tables::mime($m[1]);
304+ if (substr($mime,0,6)!='image/') error::quit('Not an image.');
305305 // Get the image info
306306 list($width,$height,$new_width,$new_height)=self::image_size(self::to_realpath(self::$real_dir_path.$file));
307307 // Show the img tag
@@ -320,12 +320,12 @@
320320 $width=$info[0];
321321 $height=$info[1];
322322 // Decide the new size.
323- if ($width>$height && $width>_CONF_THUMBNAIL_SIZE) {
324- $new_width=intval(_CONF_THUMBNAIL_SIZE);
325- $new_height=intval($height * _CONF_THUMBNAIL_SIZE / $width);
326- } elseif ($height>$width && $height>_CONF_THUMBNAIL_SIZE) {
327- $new_width=intval($width * _CONF_THUMBNAIL_SIZE / $height);
328- $new_height=intval(_CONF_THUMBNAIL_SIZE);
323+ if ($width>$height && $width>_CONF_THUMBNAIL_ADMIN_SIZE) {
324+ $new_width=intval(_CONF_THUMBNAIL_ADMIN_SIZE);
325+ $new_height=intval($height * _CONF_THUMBNAIL_ADMIN_SIZE / $width);
326+ } elseif ($height>$width && $height>_CONF_THUMBNAIL_ADMIN_SIZE) {
327+ $new_width=intval($width * _CONF_THUMBNAIL_ADMIN_SIZE / $height);
328+ $new_height=intval(_CONF_THUMBNAIL_ADMIN_SIZE);
329329 } else {
330330 $new_width=$width;
331331 $new_height=$height;
@@ -335,7 +335,7 @@
335335 static public function action_get_download(){
336336 $filename=self::$file;
337337 preg_match('/([^\.]*)$/',$filename,$m);
338- $mime=admin_media::mime($m[1]);
338+ $mime=tables::mime($m[1]);
339339 header("Content-Type: $mime; name=\"$filename\"");
340340 header("Content-disposition: attachment; filename=$filename");
341341 $full_path=self::local_file_exists(_DIR_SKINS,self::$real_file_path);
旧リポジトリブラウザで表示