strange, but your update of step 6.2 caused just a white page showed after trying to preview/send the pm...
I found the reason here:
$image_info = @get_imagesize($file_src, $info);
should be
$image_info = @getimagesize($file_src, $info);
The change did also not fix my problem with the distorted thumbnails (the thumbs were always square)
well - so I changed the function Thumb from
function thumb($id, $dim = 50, $align = "bottom") {
global $site_db, $user_info, $site_sess;
if (empty($dim)) $dim = 50;
if (empty($align)) $align = "bottom";
$text = "";
$sql = "SELECT image_name, image_id, image_media_file, image_thumb_file, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$id;
if ($row = $site_db->query_firstrow($sql)) {
if (!get_file_path($row['image_thumb_file'], "thumb", $row['cat_id'], 0, 0)) {
$file_src = ICON_PATH."/".get_file_extension($row['image_media_file']).".gif";
}else{
$file_src = get_file_path($row['image_thumb_file'], "thumb", $row['cat_id'], 0, 1);
}
$image_info = @getimagesize($file_src, $info);
$width = $image_info[0];
$height = $image_info[1];
$wh = get_resize($image_info[0], $image_info[1], $dim, $dim);
$text = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$row['image_id'])."\"><img width = \"".$wh[0]."\" height=\"".$wh[1]."\" src=\"".$file_src."\" alt=\"".str_replace("\"", """, $row['image_name'])."\" align=\"".$align."\" border=\"1\" /></a>";
}
return $text;
}
into
function thumb($id, $dim = 50, $align = "bottom") {
global $site_db, $user_info, $site_sess;
if (empty($align)) $align = "bottom";
$text = "";
$sql = "SELECT image_name, image_id, image_media_file, image_thumb_file, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$id;
if ($row = $site_db->query_firstrow($sql)) {
if (!get_file_path($row['image_thumb_file'], "thumb", $row['cat_id'], 0, 0)) {
$file_src = ICON_PATH."/".get_file_extension($row['image_media_file']).".gif";
}else{
$file_src = get_file_path($row['image_thumb_file'], "thumb", $row['cat_id'], 0, 1);
}
$image_info = @getimagesize($file_src);
$width = $image_info[0];
$height = $image_info[1];
$dimension = 50;
$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
}else {
$new_width = floor(($dimension/$height) * $width);
$new_height = $dimension;
}
$text = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$row['image_id'])."\"><img width = \"".$new_width."\" height=\"".$new_height."\" src=\"".$file_src."\" alt=\"".str_replace("\"", """, $row['image_name'])."\" align=\"".$align."\" border=\"1\" /></a>";
}
return $text;
}
and deleted the whole function get_resize()
I don't know if I messed something up with that, but it works fine now...