gd library trouble - digital camera files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
imme
Forum Newbie
Posts: 14
Joined: Fri Nov 21, 2003 11:51 am

gd library trouble - digital camera files

Post by imme »

I made a little upload area where people can store their pictures. One can choose between different thumbnail sizes etc.
The thumbnails are created using the gd lib. The list of pictures is stored in a plain textfile. It all works fine on my localhost (MacOS 10.3.5, php 4.3.7, apache 1.3x). On the server it only works partially. For some pictures from digital cameras no thumbnails are created. When trying to only open the thumbnail, I get a "Internal Server Error" message. I don't know if it has something to do with the EXIF data. The funny thing is that it works for some pictures with EXIF data. It has nothing to do with the filename, as they get processed before upload (special characters taken out etc.).
I attached the code for creating the thumbs.

$_GET['pfad'] is the path to the original file
$_GET['breite'] is the height of the thumb


Is there any way to filter the EXIF data out or to only access the raw picture data?
Thank you so much for your help

Code: Select all

<?php
$img=imagecreatefromjpeg($_GET['pfad']);

$hoehe=imagesy($img);
$breite=imagesx($img);
$prop=$breite/$hoehe;
$neuhoehe=$_GET['breite'];
$neubreite=$prop*$neuhoehe;

if($neuhoehe>$neubreite)
{
    $prop=$neubreite/$neuhoehe;
    $neubreite=$prop*$neuhoehe;
}

$thumb=imagecreatetruecolor($neubreite,$neuhoehe);
imagecopyresized($thumb,$img,0,0,0,0,$neubreite,$neuhoehe,$breite,$hoehe);
Header("Content-Type: image/jpeg");
imagejpeg($thumb,"",70);
?>
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Its probably more to do with the library versions on the server rather than the EXIF data. Check to see what differences there are.
imme
Forum Newbie
Posts: 14
Joined: Fri Nov 21, 2003 11:51 am

Post by imme »

the version on the server is actually newer. the same options are enabled.
Post Reply