Resize JPEG and no EXIF data

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I try to use PEL ( to copy some exif information from
orginial camera jpeg to resized copy with php gd library. But without

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,
imagejpeg($new_img, $destination_file.'_',$zcompression);

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


Site Timeline