sbzx
12-04-2007, 05:22 PM
Hi Gang,
For some reason after upgrading to 1.7RC1 Jay Soto's Delicious v1.1 template stopped working correctly because index.php would not return a valid value for <IMAGE_WIDTH> and <IMAGE_HEIGHT>. After some investigation I found that the problem is located in these lines:
$thumbnail_extra = getimagesize(ltrim($cfgrow['thumbnailpath'], "./")."thumb_".$image_name);
$image_extra = getimagesize(ltrim($cfgrow['imagepath'], "./").$image_name);
$image_width = $image_extra['0'];
$image_height = $image_extra['1'];
$tpl = str_replace("<IMAGE_WIDTH>",$image_width,$tpl);
$tpl = str_replace("<IMAGE_HEIGHT>",$image_height,$tpl);
$local_width = $thumbnail_extra['0'];
$local_height = $thumbnail_extra['1'];
Furthermore, "ltrim($cfgrow['imagepath'], "./").$image_name" would return a path without a leading slash as a result of which getimagesize() returns nothing. So I made a slight modification like this:
$thumbnail_extra = getimagesize("/".ltrim($cfgrow['thumbnailpath'], "./")."thumb_".$image_name);
$image_extra = getimagesize("/".ltrim($cfgrow['imagepath'], "./").$image_name);
It works now. However, I am not sure what I corrected was a flaw in PP1.7RC1 or something else in my installation.
For some reason after upgrading to 1.7RC1 Jay Soto's Delicious v1.1 template stopped working correctly because index.php would not return a valid value for <IMAGE_WIDTH> and <IMAGE_HEIGHT>. After some investigation I found that the problem is located in these lines:
$thumbnail_extra = getimagesize(ltrim($cfgrow['thumbnailpath'], "./")."thumb_".$image_name);
$image_extra = getimagesize(ltrim($cfgrow['imagepath'], "./").$image_name);
$image_width = $image_extra['0'];
$image_height = $image_extra['1'];
$tpl = str_replace("<IMAGE_WIDTH>",$image_width,$tpl);
$tpl = str_replace("<IMAGE_HEIGHT>",$image_height,$tpl);
$local_width = $thumbnail_extra['0'];
$local_height = $thumbnail_extra['1'];
Furthermore, "ltrim($cfgrow['imagepath'], "./").$image_name" would return a path without a leading slash as a result of which getimagesize() returns nothing. So I made a slight modification like this:
$thumbnail_extra = getimagesize("/".ltrim($cfgrow['thumbnailpath'], "./")."thumb_".$image_name);
$image_extra = getimagesize("/".ltrim($cfgrow['imagepath'], "./").$image_name);
It works now. However, I am not sure what I corrected was a flaw in PP1.7RC1 or something else in my installation.