NAME

Image::ExifTool::Location - Easy setting, getting of an image's location information

VERSION

This document describes Image::ExifTool::Location version 0.0.4

SYNOPSIS

use Image::ExifTool;
use Image::ExifTool::Location;

my $exif = Image::ExifTool->new();

# Extract info from existing image
$exif->ExtractInfo($src);
# Set location
$exif->SetLocation(54.787515, -2.341355);
# Set elevation
$exif->SetElevation(515);
# Write new image
$exif->WriteInfo($src, $dst);

DESCRIPTION

Image::ExifTool is a versatile module for reading and writing EXIF data in a number of image formats. This module extends its interface adding methods that simplify the reading and writing of GPS location information.

Without this module the interface for working with GPS location information is cryptic. To store latitude and longitude a total of four EXIF values are used - two to store the latitude and longitude in degrees, minutes and seconds format and two to store the hemisphere (north / south, east / west).

This module replaces that cryptic interface with simple calls (GetLocation and SetLocation) that take care of encoding and decoding the latitude and longitude values correctly.

INTERFACE

The methods this module provides are added directly to Image::ExifTool's interface. To use them do something like this:

use Image::ExifTool;
use Image::ExifTool::Location;

my $exif = Image::ExifTool->new();

$exif->ExtractInfo($src);
$exif->SetLocation(54.787515, -2.341355);
$exif->WriteInfo($src, $dst);

All of the methods described below are implemented in terms of Image::ExifTool's GetValue and SetNewValue methods. Read the documentation for Image::ExifTool for more information.

HasLocation()

Returns true if the image contains all of these EXIF tags:

GPSLatitude     GPSLatitudeRef
GPSLongitude    GPSLongitudeRef
HasElevation()

Returns true if the image contains both of these EXIF tags:

GPSAltitude     
GPSAltitudeRef
SetLocation( $lat, $lon )

Set the image's GPS location to the specified latitude and longitude.

SetElevation( $ele )

Set the image's GPS elevation to the specified height in metres. Use negative values for locations below sea level.

GetLocation()

Return the image's GPS location as a two element list:

my ($lat, $lon) = $exif->GetLocation();
GetElevation()

Return the image's GPS elevation:

my $ele = $exif->GetElevation();

DIAGNOSTICS

Call Image::ExifTool->new() instead of Image::ExifTool::Location->new()

This module adds methods directly to Image::ExifTool. After

use Image::ExifTool::Location;

create a new Image::ExifTool object as normal.

SetLocation must be called with the latitude and longitude

SetLocation requires latitude and longitude values in decimal degrees.

SetElevation must be called with the elevation in metres

SetElevation requires the elavation in metres as a signed number.

GetLocation must be called in a list context

GetLocation returns latitude and longitude as a two element list.

DEPENDENCIES

Image::ExifTool
Geo::Coordinates::DecimalDegrees

CONFIGURATION AND ENVIRONMENT

Image::ExifTool::Location requires no configuration files or environment variables.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-image-exiftool-location@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Andy Armstrong <andy@hexten.net>

LICENCE AND COPYRIGHT

Copyright (c) 2006, Andy Armstrong <andy@hexten.net>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.