PDA

View Full Version : help on exif image width?


jdleung
11-12-2007, 09:37 AM
I use two template on my site, in the past version, the template switchs depending on category and image width.

I use the following function read_exif_data_raw () to do so

$exif_result = read_exif_data_raw($curr_image,"0");
if (isset($exif_result['SubIFD'])){
$image_width = $exif_result['SubIFD']['ExifImageWidth'];
}

when the image width is more than 700px->use another template, but on v1.7, this function seems to not work when I use this function in index.php. it goes to a blank page something like php error.

how can I get the image width agian?

thanks.

Lazlo
11-12-2007, 10:03 AM
In index.php image width and height uses this code:

$image_extra = getimagesize(ltrim($cfgrow['imagepath'], "./").$image_name);
$image_width = $image_extra['0'];
$image_height = $image_extra['1'];


Maybe you can use this in your function instead of reading the EXIF data.

jdleung
11-12-2007, 04:59 PM
it works. thanks, Lazlo.