yeah...
use this version of creatthumbnail function iside the includes/function.php
PHP Code:
function createthumbnail($file) {
global $pixelpost_db_prefix;
$cfgquery = mysql_query("select * from ".$pixelpost_db_prefix."config");
$cfgrow = mysql_fetch_array($cfgquery);
// credit to codewalkers.com - there is 90% a tutorial there
$max_width = $cfgrow['thumbwidth'];
$max_height = $cfgrow['thumbheight'];
define(IMAGE_BASE, "../images");
$image_path = IMAGE_BASE . "/$file";
$img = null;
$image_path_exp = explode('.', $image_path);
$image_path_end = end($image_path_exp);
$ext = strtolower($image_path_end);
if ($ext == 'jpg' || $ext == 'jpeg') {
$img = @imagecreatefromjpeg($image_path);
} else if ($ext == 'png') {
$img = @imagecreatefrompng($image_path);
} else if ($ext == 'gif') {
$img = @imagecreatefromgif($image_path);
}
if($img) {
$width = imagesx($img);
$height = imagesy($img);
$scale = max($max_width/$width, $max_height/$height);
if($scale < 1) {
$new_width = floor($scale*$width);
$new_height = floor($scale*$height);
$tmp_img = imagecreatetruecolor($new_width,$new_height);
// gd 2.0.1 or later: imagecopyresampled
// gd less than 2.0: imagecopyresized
if(function_exists(imagecopyresampled)) {
imagecopyresampled($tmp_img, $img, 0,0,0,0,$new_width,$new_height,$width,$height);
} else {
imagecopyresized($tmp_img, $img, 0,0,0,0,$new_width,$new_height,$width,$height);
}
imagedestroy($img);
$img = $tmp_img;
}
if($cfgrow['crop'] == "yes" | $cfgrow['crop'] == "12c") {
// crop
$tmp_img = imagecreatetruecolor($max_width,$max_height);
if(function_exists(imagecopyresampled)) {
imagecopyresampled($tmp_img, $img, 0,0,0,0,$max_width,$max_height,$max_width,$max_height);
} else {
imagecopyresized($tmp_img, $img, 0,0,0,0,$max_width,$max_height,$max_width,$max_height);
}
imagedestroy($img);
$img = $tmp_img;
} // end crop yes
}
imagejpeg($img, "../thumbnails/thumb_$file",$cfgrow['compression']);
$thumbimage = "../thumbnails/thumb_$file";
chmod($thumbimage,0644);
}
this version will be used in the 1.5.