"Al Pro" <applepro7777 gmail.com> writes:
Hi,
Your message was stuck in moderation -- I have now
configured the list
to allow your address to post. I've CCed this reply to you
too, let us
know if you don't want that.
> I'm very new to OOP and PEL is really scares me.
Well, PEL is rather OO heavy... consider it a fun way to
learn OO
> I'm trying to read GPS data from photos, but I can't.
>
> I'm trying this:
>
> --------------------
> $file =3D "/home/re/gps1.jpg";
> $data =3D new PelDataWindow(file_get_contents($file));
>
> $jpeg =3D new PelJpeg();
> $jpeg->load($data);
In PEL 0.9.1 you can simply do
$jpeg =3D new PelJpeg($file);
and then PEL will figure out to load the data from the file.
It is
simply shorter than what you wrote, but does the same.
> $app1 =3D $jpeg->getExif();
> $tiff =3D $app1->getTiff();
>
> $ifd0 =3D $tiff->getIfd();
> $entry =3D $ifd0->getEntry(PelTag::GPS_LONGITUDE);
>
> print "Longitude: ".$entry;
> --------------------
>
> But I get nothing. What am I doing wrong?
The GPS data is not stored in the IFD0. So the getEntry()
call returns
null. You need to do:
$gps =3D $ifd0->getSubIfd(PelIfd::GPS);
and then your GPS_LONGITUDE entry should be in the $gps
IFD.
If you think this is complicated, then I agree PEL parses
the
structure for you, but you still need to know where to find
the right
bits of information. Using the dump-image.php file can
help.
> Another question is how can I easy add Exiff data, even
if JPEG file
> doesn't have any Exif data in it? Is there any PHP
sample that shows
> how can I do it?
Please have a look at this URL in which a user explained how
he added
data (including GPS!) to an empty JPEG file:
http://sf.net/tracker/?fun
c=3Ddetail&atid=3D650323&aid=3D1815728&group_id=
=3D108380
=2D-=20
Martin Geisler --- <mgeisler mgeisler.net> --- http://mgeisler.net
------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
PEL-devel mailing list
PEL-devel lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pel-devel
|