[Gdal-dev] Unable to copy EXIF metadata with CreateCopy
Even Rouault
even.rouault at mines-paris.org
Sun Sep 9 15:14:25 EDT 2007
Hi,
Unfortunately, there's little you can do since the GDAL Jpeg driver doesn't
support the writing of EXIF metadata. It only supports reading of them.
You may want to try another solution to transfer EXIF metadata. Try looking at
http://en.wikipedia.org/wiki/Exif#Applications_for_Editing_Exif. I've just
tested jhead (http://freshmeat.net/projects/jhead). It seems to work.
jhead -te mysourcefile.jpg mydestfile.jpg should do the job.
Side node : if we want to implement this in GDAL, jhead could be a start point
as its licence is public domain. But we've probably already all the wanted
logic in libtiff anyway.
Best regards,
Even
On Sunday 09 September 2007 20:45:43 marcello ferrero wrote:
> Hi,
> I need to write the GPSLatitude and GPSLongitude tags into a jpg raster
> image (typically a photo taken with a camera), I started doing some test
> but I noticed that CreateCopy does not copy the EXIF metadata (or at least
> I've not been able to make it working).
>
> This is the example code I'm using:
>
> hDriver = GDALGetDriverByName( "JPEG" );
> hDataset = GDALOpen( "MySourceFile.jpg", GA_ReadOnly );
> hDstDS = GDALCreateCopy( hDriver, "MyDestFile.jpg", hDataset, TRUE, NULL,
> NULL, NULL );
>
>
> As a result MyDestFile.jpg does not contain any EXIF metadata while the
> source file has a lot of EXIF tags.
>
> Any idea?
>
> Marcello Ferrero
>
>
>
> ___________________________________________________________________________
>_________ Pinpoint customers who are looking for what you sell.
> http://searchmarketing.yahoo.com/
More information about the Gdal-dev
mailing list