|
myAlbum 1.0.2 не делает Thumb...
|
||||
|---|---|---|---|---|
|
Just popping in
![]()
|
В общем новая версия не делает маленькие иконки.
Старая их делает без проблем. В чём может быть дело и как это исправить?
Posted on: 2003/4/4 18:25
|
|||
|
||||
|
Re: myAlbum 1.0.2 не делает Thumb...
|
||||
|---|---|---|---|---|
|
Just popping in
![]()
|
Quote:
Может чего с библиотекой GD случилось? А как же тогда первая их делает? Quote: За создание маленьких изображений отвечает function createThumb в include/functions.php... Сейчас запихну этот файл от первой во вторую версию ;)
Posted on: 2003/4/5 2:20
|
|||
|
||||
|
Re: myAlbum 1.0.2 не делает Thumb...
|
||||
|---|---|---|---|---|
|
Just popping in
![]()
|
Hermit
Спасибо за помощь! Я заменил это: function createThumb($imagePath, $name, $ext) { global $mylinks_shotwidth; switch (strtolower($ext)){ case "gif": //no gif support, bif thumbs! copy($imagePath, XOOPS_ROOT_PATH."/modules/myalbum/photos/thumbs/$name.$ext"); break; case "jpg": $src_img = ImageCreateFromjpeg($imagePath); $image_stats = GetImageSize($imagePath); $imagewidth = $image_stats[0]; $imageheight = $image_stats[1]; $new_w = $mylinks_shotwidth; $scale = ($imagewidth / $new_w); $new_h = round($imageheight / $scale); $dst_img = ImageCreate($new_w,$new_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); Imagejpeg($dst_img, XOOPS_ROOT_PATH."/modules/myalbum/photos/thumbs/$name.$ext"); imagedestroy($src_img); imagedestroy($dst_img); break; case "png": $src_img = ImageCreateFrompng($imagePath); $image_stats = GetImageSize($imagePath); $imagewidth = $image_stats[0]; $imageheight = $image_stats[1]; $new_w = 140; $scale = ($imagewidth / $new_w); $new_h = round($imageheight / $scale); $dst_img = ImageCreate($new_w,$new_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); Imagepng($dst_img, XOOPS_ROOT_PATH."/modules/myalbum/photos/thumbs/$name.$ext"); imagedestroy($src_img); imagedestroy($dst_img); break; } } на это (из первой версии): function createThumb($imagePath, $name, $ext) { global $mylinks_shotwidth; switch (strtolower($ext)){ case "gif": //no gif support, bif thumbs! copy($imagePath, XOOPS_ROOT_PATH."/modules/myalbum/photos/thumbs/$name.$ext"); break; case "jpg": $src_img = ImageCreateFromjpeg($imagePath); $image_stats = GetImageSize($imagePath); $imagewidth = $image_stats[0]; $imageheight = $image_stats[1]; $new_w = $mylinks_shotwidth; $scale = ($imagewidth / $new_w); $new_h = round($imageheight / $scale); $dst_img = ImageCreate($new_w,$new_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); Imagejpeg($dst_img, XOOPS_ROOT_PATH."/modules/myalbum/photos/thumbs/$name.$ext"); imagedestroy($src_img); imagedestroy($dst_img); break; case "png": $src_img = ImageCreateFrompng($imagePath); $image_stats = GetImageSize($imagePath); $imagewidth = $image_stats[0]; $imageheight = $image_stats[1]; $new_w = 140; $scale = ($imagewidth / $new_w); $new_h = round($imageheight / $scale); $dst_img = ImageCreate($new_w,$new_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); Imagepng($dst_img, XOOPS_ROOT_PATH."/modules/myalbum/photos/thumbs/$name.$ext"); imagedestroy($src_img); imagedestroy($dst_img); break; } } Всё заработало!
Posted on: 2003/4/6 5:34
|
|||
|
||||

