By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,688 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

Resize JPEG and no EXIF data

P: n/a
Hi.

I try to use PEL (pel.sourceforge.net) to copy some exif information from
orginial camera jpeg to resized copy with php gd library. But without
success:(
1) File is uploaded to server with html upload form.

2) File is testes is it image/jpeg ?

3) If yes:

4) $copy = copy($_FILES['fotofile_'.$nrx]['tmp_name'],$destination_file);

5) if file height or width is too large - it's scaled:

$new_img = imagecreatetruecolor($new_x, $new_y);
$img = imagecreatefromjpeg($destination_file);
$org_x = imagesx($img);
$org_y = imagesy($img);
imagecopyresampled($new_img, $img,0, 0, 0, 0, $new_x, $new_y, $org_x,
$org_y);
imagejpeg($new_img, $destination_file.'_',$zcompression);
unlink(destination_file);
rename($destination_file.'_',$destination_file);
imagedestroy($new_img);
imagedestroy($img);
Now I've got smaller scaled new $destination_file. But it is without any
exif data now.
How to write a few exif information to it ? I need Camera Manufacturer,
Camera Model, Date&Time and ExposureTime, and ApertureFNumber

Of course I know how to read these informations before rescaling (I use
exif_read_data php function). But I cannot wirte them to new image ........

Thanx a lot for help

Tomm


Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.