Hello,

sorry about my bad english, I hope you understand me.

I tried to add tags for the gps-coordinates to a jpeg-file with existing
Exif-data.
This is, what I do (e.g. LAT 52° 30’ 45.0’’ and LON 9° 15’ 30.0’’):

$jpeg = new PelJpeg($filename);
$tiff = $exif->getTiff();
$ifd0 = $tiff->getIfd();
$desc1 = new PelEntryRational(PelTag::GPS_LATITUDE, array(52,1),
array(30,1), array(45,1));
$ifd0->addEntry($desc1);
$desc2 = new PelEntryRational(PelTag::GPS_LONGITUDE, array(9,1),
array(15,1), array(30,1));
$ifd0->addEntry($desc2);
$desc3 = new PelEntryAscii(PelTag::IMAGE_DESCRIPTION, 'only for test');
$ifd0->addEntry($desc3);
file_put_contents($new_filename, $jpeg->getBytes());

After processing the script (with no errors), there a no gps-tags in the
file.
If read the exif with:

$jpeg = new PelJpeg($filename);
$tiff = $exif->getTiff();
$ifd0 = $tiff->getIfd();
$lat = $ifd0->getEntry(PelTag::GPS_LATITUDE);
$lon = $ifd0->getEntry(PelTag::GPS_LONGITUDE);
$test = $ifd0->getEntry(PelTag:: IMAGE_DESCRIPTION);

The result is: $lat and $lon both are null, but $test is filled correctly.

What is my fault?

Greets, André
           

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
PEL-devel mailing list
PEL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pel-devel

Reply via email to