Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > SUPPORT / INFORMATION > Pixelpost Help

Post Reply
 
Thread Tools
  #1  
Old 12-04-2007, 05:22 PM
sbzx's Avatar
sbzx Offline
pp veteran
 
Join Date: Jun 2005
Location: Szentendre, Hungary
Posts: 66
Send a message via Skype™ to sbzx
Exclamation image_width and image_height are empty

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:

Code:
$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:

Code:
$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.
__________________
:: sbzx

usualsubjects.com
Reply With Quote
  #2  
Old 12-04-2007, 05:41 PM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
really funny.
Since $cfgrow['imagepath'] usually is "../images/" (the path seen from admin) ltrim($cfgrow['imagepath'], "./") will result as "images/" what is the correct path seen from index.php.
Anyway "/images/" should be the same as "images/"

In my blog (which uses the almost most actual developer version of 1.7) the width and height is shown correct without any hack...
__________________
Uh!log Photoblog
My Addons
Reply With Quote
  #3  
Old 12-04-2007, 06:13 PM
sbzx's Avatar
sbzx Offline
pp veteran
 
Join Date: Jun 2005
Location: Szentendre, Hungary
Posts: 66
Send a message via Skype™ to sbzx
What is really funny is that I have a second installation on my local Linux which does not show this symptom. The one that experiences the problem is on eleven2, pretty much a standard environment. Plus it is an upgrade from 1.4.2 that worked perfectly before... Well, I don't know, I think I'll give it some more thought.
__________________
:: sbzx

usualsubjects.com
Reply With Quote
  #4  
Old 12-05-2007, 06:20 AM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
yes, do so and tell us please! 'cause I have no idea :-/
__________________
Uh!log Photoblog
My Addons
Reply With Quote
  #5  
Old 12-05-2007, 10:11 PM
sbzx's Avatar
sbzx Offline
pp veteran
 
Join Date: Jun 2005
Location: Szentendre, Hungary
Posts: 66
Send a message via Skype™ to sbzx
Lightbulb

I guess it's what it is...

Site A, the one that works without the hack:
Code:
Guessed imagepath: /var/www/html_un/images/
Configured Imagepath: ../images/
Guessed thumbnailpath /var/www/html_un/thumbnails/
Configured Thumbnailpath ../thumbnails/
Site B, the one that needs the hack:
Code:
Guessed imagepath: /home/sbzx/public_html/images/
Configured Imagepath: /home/sbzx/public_html/images/
Guessed thumbnailpath /home/sbzx/public_html/thumbnails/
Configured Thumbnailpath ../thumbnails/
Corrected.
__________________
:: sbzx

usualsubjects.com
Reply With Quote
  #6  
Old 12-06-2007, 12:47 AM
dakwegmo's Avatar
dakwegmo+ Offline
Team Pixelpost
 
Join Date: Jul 2005
Location: West of Between
Posts: 689
Does the one that needs the hack work if you change the configured image path to ../images?
__________________
My Photoblog
If you find my help useful please consider feeding the PixelPost Kitty
If you're short on cash just feed my ego
Reply With Quote
  #7  
Old 12-06-2007, 06:26 AM
sbzx's Avatar
sbzx Offline
pp veteran
 
Join Date: Jun 2005
Location: Szentendre, Hungary
Posts: 66
Send a message via Skype™ to sbzx
No. Leaving the hack in the code and changing the image path to ../images results in an empty $image_extra. However, restoring the original code works perfectly with the new and correct image path.
__________________
:: sbzx

usualsubjects.com
Reply With Quote
  #8  
Old 12-06-2007, 08:00 AM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
funny that the configured image path is changing on upgrade procedure.
I guess we have to have a look into that
__________________
Uh!log Photoblog
My Addons
Reply With Quote
  #9  
Old 03-23-2008, 04:20 AM
JETC Offline
pp regular
 
Join Date: Mar 2006
Posts: 36
Ok, so I *just* updated my blog to pixelpost v1.7.1 and I was scratching my head when <IMAGE_WIDTH> and <IMAGE_HEIGHT> wasn't returning any values. I re-configured the image path and everything works again.

Just letting you guys know that it's still a problem. Maybe change the upgrade/install to configure the paths to ../images/ and ../thumbnails/?
__________________
JETCs Photoblog
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 09:57 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs