J-ExifTool v0.0.3

Today I’ve released version 0.0.3 of J-ExifTool. This version adds support for GPS tags.

This new version adds 1 new methods to JExifInfo which allows you to set all mandatory GPS tags at once (a JExifValidationException is thrown when a parameter is missing, other than that there’s no validation)

  • setGPSInfo

The new jar can be downloaded from BitBucket.

Following examples explain how to use the setGPSInfo method.

Example 1: decimal format

Following example will place the image at 50.84791165546716N 4.350469368264016E at an altitude of 50m above sea level (0 == above sea level).

 JExifTool tool = new JExifTool();
 JExifInfo gpsInfo = tool.getInfo(new File("gps.jpg"));
 gpsInfo.setGPSInfo("50.84791165546716", "N", "4.350469368264016", "E", "50", "0");
 tool.stop();
 

Example 2: DMS format

This example will place the image at 100m below sea level (1 == below sea leven) somewhere in the South Pacific Ocean (at 60.586967S 131.835938W)

JExifTool tool = new JExifTool();
JExifInfo gpsInfo = tool.getInfo(new File("gps.jpg"));
gpsInfo.setGPSInfo("60 35 13.08", "S", "131 50 9.38", "W", "100", "1");
tool.stop();

Just for reference, v0.0.3 = revision dbd80ff67380.

Advertisements