Hi.
I try to use PEL (pel.sourceforg e.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_'.$nr x]['tmp_name'],$destination_f ile);
5) if file height or width is too large - it's scaled:
$new_img = imagecreatetrue color($new_x, $new_y);
$img = imagecreatefrom jpeg($destinati on_file);
$org_x = imagesx($img);
$org_y = imagesy($img);
imagecopyresamp led($new_img, $img,0, 0, 0, 0, $new_x, $new_y, $org_x,
$org_y);
imagejpeg($new_ img, $destination_fi le.'_',$zcompre ssion);
unlink(destinat ion_file);
rename($destina tion_file.'_',$ destination_fil e);
imagedestroy($n ew_img);
imagedestroy($i mg);
Now I've got smaller scaled new $destination_fi le. 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
I try to use PEL (pel.sourceforg e.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_'.$nr x]['tmp_name'],$destination_f ile);
5) if file height or width is too large - it's scaled:
$new_img = imagecreatetrue color($new_x, $new_y);
$img = imagecreatefrom jpeg($destinati on_file);
$org_x = imagesx($img);
$org_y = imagesy($img);
imagecopyresamp led($new_img, $img,0, 0, 0, 0, $new_x, $new_y, $org_x,
$org_y);
imagejpeg($new_ img, $destination_fi le.'_',$zcompre ssion);
unlink(destinat ion_file);
rename($destina tion_file.'_',$ destination_fil e);
imagedestroy($n ew_img);
imagedestroy($i mg);
Now I've got smaller scaled new $destination_fi le. 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