PDA

View Full Version : Where is the original image size stored?



Jerome
06-02-2005, 07:49 AM
I'd like the popup window, that you helped me create, to open with the same size as the image it displays.
I thought from reading the code, that by just adding $imagewidth and $imageheight into the javascript, that it would work. But these variables give me the value of the thumbnail size. I thought that they where the original image size, since I think that $displaywidth and $displayheight are there to output the thumbnail size.
I'm working on this inside image.inc.php and
inside function renderListingsImagesJavaRows

I've also experimented with $imagedata[0] and $imagedata[1], but I get the same values as with the rest.



// gotta grab the image size
$imagedata = GetImageSize("$config[listings_upload_path]/$thumb_file_name");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$shrinkage = $config['thumbnail_width']/$imagewidth;
$displaywidth = $imagewidth * $shrinkage;
$displayheight = $imageheight * $shrinkage;

pbflash
06-02-2005, 08:50 AM
You're getting the thumbnail info because that is the info you're telling it to read.

$imagedata =GetImageSize("$config[listings_upload_path]/$thumb_file_name");

You need to look at the file_name not thumb_file_name.

mamboindo
06-02-2005, 10:39 AM
You're getting the thumbnail info because that is the info you're telling it to read.

$imagedata =GetImageSize("$config[listings_upload_path]/$thumb_file_name");

You need to look at the file_name not thumb_file_name.

Can you explain that to me since I do not understand the reason?

Jerome
06-02-2005, 10:45 AM
Thanks again for pointing me into the right direction. As I said, I've never programmed in my life before (well only html if you can call that programming), so I'm really just trying to run before I can walk.

I succesfuly created my on variables like this:



$bigdata = GetImageSize("$config[listings_upload_path]/$file_name");
$bigwidth = $bigdata[0];
$bigheight = $bigdata[1];


And then I applied them to the popup window javascritp:


$display .= "<a href=\"javascript:MM_openBrWindow('index.php?action=view_ listing_image&amp;image_id=$imageID&amp;popup=yes','','hei ght=$bigheight,width=$bigwidth')\">";


Thanks again, I hope that this code can help someone else that might want to achieve the same.