1. P_W999
  2. J-Exiftool

Commits

P_W999  committed d470e8f

-v0.0.3: added support for GPS tags

  • Participants
  • Parent commits d4a45a6
  • Branches master

Comments (0)

Files changed (25)

File data/exifIFD.ods

  • Ignore whitespace
Binary file modified.

File releases/jar-release.jardesc

View file
  • Ignore whitespace
 <?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
 <jardesc>
-    <jar path="J-ExifTool/releases/j-exiftool-0.0.2.jar"/>
+    <jar path="J-ExifTool/releases/j-exiftool-0.0.3.jar"/>
     <options buildIfNeeded="true" compress="true" descriptionLocation="/J-ExifTool/releases/jar-release.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="true" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
     <storedRefactorings deprecationInfo="true" structuralOnly="false"/>
     <selectedProjects/>

File src/be/pw/jexif/DemoApp.java

View file
  • Ignore whitespace
 
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.enums.tag.ExifIFD;
+import be.pw.jexif.enums.tag.ExifGPS;
 import be.pw.jexif.exception.ExifError;
 import be.pw.jexif.exception.JExifException;
 import be.pw.jexif.internal.constants.ExecutionConstant;
 		JExifInfo info3 = tool.getInfo(new File("test-resources/read03.JPG"));
 		JExifInfo info4 = tool.getInfo(new File("test-resources/read04.JPG"));
 		File tmp = File.createTempFile("jexiftool", ".jpg");
+		File gps = File.createTempFile("gpstest", ".jpg");
 		tmp.deleteOnExit();
+		//gps.deleteOnExit();
 		Files.copy(new File("test-resources/read04.JPG"), tmp);
+		Files.copy(new File("test-resources/read04.JPG"), gps);
 
 		// tool.stop();
 		JExifInfo write1 = tool.getInfo(tmp);
 
 		System.out.println(Cal10nUtil.get(Errors.GENERAL, "test"));
 
+		JExifInfo gpsInfo = tool.getInfo(gps);
+		//50.84791165546716N 4.350469368264016E == Bourse @ Brussels
+		gpsInfo.setGPSInfo("50.84791165546716", "N", "4.350469368264016", "E", "50", "0");
+		tool.stop();
+		
 		LOG.info("Executing took {} ms", watch.elapsedTime(TimeUnit.MILLISECONDS));
 		LOG.info("Finished main method");
 	}

File src/be/pw/jexif/JExifInfo.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 package be.pw.jexif;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Map;
 
+import be.pw.jexif.enums.tag.ExifGPS;
 import be.pw.jexif.enums.tag.Tag;
 import be.pw.jexif.exception.ExifError;
 import be.pw.jexif.exception.JExifException;
     }
     
     /**
+     * 
+     * @param GPSLatitude gps latitude
+     * @param GPSLatitudeRef N or S (Northern or Southern hemisphere)
+     * @param GPSLongitude gps longitude
+     * @param GPSLongitudeRef E or W (Eastern or Western)
+     * @param GPSAltitude gps altitude (always a positive value).
+     * @param GPSAltitudeRef 0 or 1 (above sea level or below sea level)
+     * @throws JExifException in case something goes wrong internally.
+     * @throws ExifError      if something went wrong in ExifTool
+     */
+    @Beta
+    public void setGPSInfo(String GPSLatitude, String GPSLatitudeRef, String GPSLongitude, String GPSLongitudeRef, String GPSAltitude, String GPSAltitudeRef) throws ExifError, JExifException {
+    	Map<Tag, String> valuesToWrite = new HashMap<Tag, String>(6);
+    	valuesToWrite.put(ExifGPS.GPSALTITUDE, GPSAltitude);
+    	valuesToWrite.put(ExifGPS.GPSALTITUDEREF, GPSAltitudeRef);
+    	valuesToWrite.put(ExifGPS.GPSLATITUDE, GPSLatitude);
+    	valuesToWrite.put(ExifGPS.GPSLATITUDEREF, GPSLatitudeRef);
+    	valuesToWrite.put(ExifGPS.GPSLONGITUDE, GPSLongitude);
+    	valuesToWrite.put(ExifGPS.GPSLONGITUDEREF, GPSLongitudeRef);
+    	exifTool.writeGPSTagInfo(file, valuesToWrite);
+    }
+    
+    /**
      * Reads out all the tag values in human read-able format, even the ones not known in J-ExifTool. 
      * 
      * @return a map with all the tag values.

File src/be/pw/jexif/JExifTool.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 import be.pw.jexif.internal.thread.event.DebugHandler;
 import be.pw.jexif.internal.thread.event.EventHandler;
 import be.pw.jexif.internal.util.Cal10nUtil;
+import be.pw.jexif.internal.util.GPSUtil;
 
 import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
             } else {
                 action = ActionFactory.createReadAction(file, tag);
             }
+            handler = new EventHandler();
+            bus.register(handler);
+            LOG.trace("Registered the EventHandler");
             String[] arguments = action.buildArguments();
             for (String argument : arguments) {
                 argsWriter.append(argument).append("\r\n");
             }
-            handler = new EventHandler();
-            bus.register(handler);
-            LOG.trace("Registered the EventHandler");
             argsWriter.flush();
             while (!handler.isFinished() && i <= deadLock) {
                 Thread.sleep(50);
             Map<Tag, String> valuesToWrite = new HashMap<>(1);
             valuesToWrite.put(tag, value);
             action = ActionFactory.createTagWriteAction(file, valuesToWrite);
+            handler = new EventHandler();
+            bus.register(handler);
+            LOG.trace("Registered the EventHandler");
             String[] arguments = action.buildArguments();
             for (String argument : arguments) {
                 argsWriter.append(argument).append("\r\n");
             }
+            argsWriter.flush();
+            while (!handler.isFinished() && i <= deadLock) {
+                Thread.sleep(50);
+                i += 50;
+            }
+            if (!handler.isFinished()) {
+                LOG.error(Cal10nUtil.get(Errors.DEADLOCK, i));
+                throw new JExifException(Cal10nUtil.get(Errors.DEADLOCK, i));
+            }
+            bus.unregister(handler);
+        } catch (IOException e) {
+            LOG.error(Cal10nUtil.get(Errors.IO_ARGSFILE), e);
+            throw new JExifException(e);
+        } catch (InterruptedException e) {
+            LOG.error(Cal10nUtil.get(Errors.INTERRUPTED_SLEEP), e);
+            throw new JExifException(e);
+        }
+        LOG.trace("Handler finished");
+        List<String> results = handler.getResultList();
+        List<String> errors = handler.getErrorList();
+        LOG.trace("Parsing results");
+        ResultHandler.run(action, results, errors);
+    }
+
+    /**
+     * This method will write a value to a given Tag.
+     * @param file the file to which the value should be written.
+     * @param valuesToWrite the value to write
+     * @throws JExifException when writing the argsfile went wrong or when the Tread.sleep caused problems (or the execution took to long).
+     * @throws ExifError      if there was a problem in ExifTool
+     */
+    void writeGPSTagInfo(final File file, final Map<Tag, String> valuesToWrite) throws ExifError, JExifException {
+        startIfNecessary();
+        int i = 0;
+        IAction action;
+        EventHandler handler;
+        try {
+            LOG.trace("Starting readTagInfo");
+            GPSUtil.validateGPSValues(valuesToWrite);
+            action = ActionFactory.createTagWriteAction(file, valuesToWrite);
+            String[] arguments = action.buildArguments();
             handler = new EventHandler();
             bus.register(handler);
             LOG.trace("Registered the EventHandler");
+            for (String argument : arguments) {
+                argsWriter.append(argument).append("\r\n");
+            }
             argsWriter.flush();
-            while (!handler.isFinished() && i <= deadLock) {
+            while (!handler.isFinished() && i <= deadLock * 1.2) {	//slightly (random) longer delay because of multiple values to write
                 Thread.sleep(50);
                 i += 50;
             }
         LOG.trace("Parsing results");
         ResultHandler.run(action, results, errors);
     }
-
+    
     /**
      * Returns all the tags, even the ones not known in J-ExifTool.
      * 
             } else {
             	action = ActionFactory.createTagReadAllAction(file);
             }
+            handler = new EventHandler();
+            bus.register(handler);
+            LOG.trace("Registered the EventHandler");
             String[] arguments = action.buildArguments();
             for (String argument : arguments) {
                 argsWriter.append(argument).append("\r\n");
             }
-            handler = new EventHandler();
-            bus.register(handler);
-            LOG.trace("Registered the EventHandler");
             argsWriter.flush();
             while (!handler.isFinished() && i <= deadLock) {
                 Thread.sleep(50);

File src/be/pw/jexif/enums/Errors.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 @BaseName("errorMessages")
 @LocaleData({@Locale("en")})
 public enum Errors {
-    GENERAL, EXIFTHREAD, IO_ARGSFILE, IO_CLOSING, INTERRUPTED_SLEEP, DEADLOCK, VALIDATION_TAGLIST, IO_BUILD_ARGUMENTS, VALIDATION_VALUESLIST, EXIFTOOL_EXECUTION_ERROR, EXIFTOOL_EXECUTION_WARNING, RETREIVE_PARSER_ERROR, PARSER_UNKNOWNTYPE, PARSER_MISMATCH, VALIDATION_WRITE_PROTECTED_TAG, VALIDATION_WRITE_AVOIDED_TAG, VALIDATION_WRITE_UNSAFE_TAG, UNKNOWN_DATATYPE, VALIDATION_NEGATIVE_UNSIGNED, VALIDATION_EXCEEDS_LIMITS, VALIDATION_RAT_FOR_INT, VALIDATION_INVALID_TYPE, IO_FILE_NOT_VALID
+    GENERAL, EXIFTHREAD, IO_ARGSFILE, IO_CLOSING, INTERRUPTED_SLEEP, DEADLOCK, VALIDATION_TAGLIST, IO_BUILD_ARGUMENTS, VALIDATION_VALUESLIST, EXIFTOOL_EXECUTION_ERROR, EXIFTOOL_EXECUTION_WARNING, RETREIVE_PARSER_ERROR, PARSER_UNKNOWNTYPE, PARSER_MISMATCH, VALIDATION_WRITE_PROTECTED_TAG, VALIDATION_WRITE_AVOIDED_TAG, VALIDATION_WRITE_UNSAFE_TAG, UNKNOWN_DATATYPE, VALIDATION_NEGATIVE_UNSIGNED, VALIDATION_EXCEEDS_LIMITS, VALIDATION_RAT_FOR_INT, VALIDATION_INVALID_TYPE, IO_FILE_NOT_VALID, GPS_MISSING_FIELD
 }

File src/be/pw/jexif/enums/tag/ExifGPS.java

View file
  • Ignore whitespace
+/*******************************************************************************
+ * Copyright 2012 P_W999
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package be.pw.jexif.enums.tag;
+
+import static be.pw.jexif.enums.DataType.INT16U;
+import static be.pw.jexif.enums.DataType.INT8U;
+import static be.pw.jexif.enums.DataType.RAT64U;
+import static be.pw.jexif.enums.DataType.STRING;
+import static be.pw.jexif.enums.DataType.UNDEF;
+import be.pw.jexif.enums.DataType;
+
+/**
+ * @author phillip
+ */
+public enum ExifGPS implements Tag {
+	GPSVERSIONID("GPSVersionID", false, false, false, INT8U), GPSLATITUDEREF("GPSLatitudeRef", false, false, false, STRING), GPSLATITUDE("GPSLatitude", false, false, false, RAT64U), GPSLONGITUDEREF("GPSLongitudeRef", false, false, false, STRING), GPSLONGITUDE("GPSLongitude", false, false, false, RAT64U), GPSALTITUDEREF("GPSAltitudeRef", false, false, false, INT8U), GPSALTITUDE("GPSAltitude", false, false, false, RAT64U), GPSTIMESTAMP("GPSTimeStamp", false, false, false, RAT64U), GPSSATELLITES("GPSSatellites", false, false, false, STRING), GPSSTATUS("GPSStatus", false, false, false, STRING), GPSMEASUREMODE("GPSMeasureMode", false, false, false, STRING), GPSDOP("GPSDOP", false, false, false, RAT64U), GPSSPEEDREF("GPSSpeedRef", false, false, false, STRING), GPSSPEED("GPSSpeed", false, false, false, RAT64U), GPSTRACKREF("GPSTrackRef", false, false, false, STRING), GPSTRACK("GPSTrack", false, false, false, RAT64U), GPSIMGDIRECTIONREF("GPSImgDirectionRef", false, false, false, STRING), GPSIMGDIRECTION("GPSImgDirection", false, false, false, RAT64U), GPSMAPDATUM("GPSMapDatum", false, false, false, STRING), GPSDESTLATITUDEREF("GPSDestLatitudeRef", false, false, false, STRING), GPSDESTLATITUDE("GPSDestLatitude", false, false, false, RAT64U), GPSDESTLONGITUDEREF("GPSDestLongitudeRef", false, false, false, STRING), GPSDESTLONGITUDE("GPSDestLongitude", false, false, false, RAT64U), GPSDESTBEARINGREF("GPSDestBearingRef", false, false, false, STRING), GPSDESTBEARING("GPSDestBearing", false, false, false, RAT64U), GPSDESTDISTANCEREF("GPSDestDistanceRef", false, false, false, STRING), GPSDESTDISTANCE("GPSDestDistance", false, false, false, RAT64U), GPSPROCESSINGMETHOD("GPSProcessingMethod", false, false, false, UNDEF), GPSAREAINFORMATION("GPSAreaInformation", false, false, false, UNDEF), GPSDATESTAMP("GPSDateStamp", false, false, false, STRING), GPSDIFFERENTIAL("GPSDifferential", false, false, false, INT16U), GPSHPOSITIONINGERROR("GPSHPositioningError", false, false, false, RAT64U);
+
+	private final boolean avoided;
+	private final boolean unsafe;
+	private final boolean protectedField;
+	private final String name;
+	private final DataType type;
+
+	/**
+	 * @param avoided indicate that the tag is avoided
+	 * @param unsafe indicated that the tag is unsafe
+	 * @param protectedField indicate that the tag is protected
+	 * @param name the name of the tag
+	 * @param type the data type of the tag
+	 */
+	private ExifGPS(final String name, final boolean unsafe, final boolean avoided, final boolean protectedField, final DataType type) {
+		this.avoided = avoided;
+		this.unsafe = unsafe;
+		this.protectedField = protectedField;
+		this.name = name;
+		this.type = type;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see be.pw.jexif.enums.tag.Tag#isAvoided()
+	 */
+	@Override
+	public final boolean isAvoided() {
+		return avoided;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see be.pw.jexif.enums.tag.Tag#isUnsafe()
+	 */
+	@Override
+	public final boolean isUnsafe() {
+		return unsafe;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see be.pw.jexif.enums.tag.Tag#isProtectedField()
+	 */
+	@Override
+	public final boolean isProtectedField() {
+		return protectedField;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see be.pw.jexif.enums.tag.Tag#getName()
+	 */
+	@Override
+	public final String getName() {
+		return name;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see be.pw.jexif.enums.tag.Tag#getType()
+	 */
+	@Override
+	public final DataType getType() {
+		return type;
+	}
+
+}

File src/be/pw/jexif/enums/tag/ExifIFD.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/enums/tag/IFD0.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/enums/tag/Tag.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/internal/action/impl/TagReadAllAction.java

View file
  • Ignore whitespace
+/*******************************************************************************
+ * Copyright 2012 P_W999
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
 /**
  * 
  */

File src/be/pw/jexif/internal/action/impl/TagReadExactAllAction.java

View file
  • Ignore whitespace
+/*******************************************************************************
+ * Copyright 2012 P_W999
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
 /**
  * 
  */

File src/be/pw/jexif/internal/constants/ExecutionConstant.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/internal/result/ResultHandler.java

View file
  • Ignore whitespace
  ******************************************************************************/
 package be.pw.jexif.internal.result;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.slf4j.Logger;
 				LOG.trace("[{}] - {} results were found", uid, result.size());
 				parser = ParserFactory.getInstance(action);
 				LOG.trace("[{}] - Parser {} was retreived", uid, parser.getClass().getSimpleName());
-				parser.parse(action, uid, result);
+				List<String> fixedResult = new ArrayList<>();	//quick fix for concurrent modification exception
+				fixedResult.addAll(result);
+				parser.parse(action, uid, fixedResult);
 			} catch (JExifException e) {
 				LOG.error(Cal10nUtil.get(Errors.RETREIVE_PARSER_ERROR, uid), e);
 				LOG.warn("[{}] - There will be no results", uid);

File src/be/pw/jexif/internal/thread/event/ErrorEvent.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/internal/thread/event/EventHandler.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/internal/thread/event/InputEvent.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/internal/util/Cal10nUtil.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/internal/util/DateUtil.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

File src/be/pw/jexif/internal/util/TagUtil.java

View file
  • Ignore whitespace
 /*******************************************************************************
  * Copyright 2012 P_W999
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 import be.pw.jexif.enums.DataType;
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.enums.tag.ExifIFD;
+import be.pw.jexif.enums.tag.ExifGPS;
 import be.pw.jexif.enums.tag.IFD0;
 import be.pw.jexif.enums.tag.Tag;
 import be.pw.jexif.exception.JExifException;
     static { // TODO: make this nicer, allow user to add custom tags and stuff
         Tag[] exifIFDValues = ExifIFD.values();
         Tag[] ifd0Values = IFD0.values();
+        Tag[] gpsValues = ExifGPS.values();
         TAG_LOOKUP_MAP = new HashMap<>(exifIFDValues.length + ifd0Values.length);
 
         for (Tag tag : exifIFDValues) {
         for (Tag tag : ifd0Values) {
             TAG_LOOKUP_MAP.put(tag.getName(), tag);
         }
+        
+        for (Tag tag : gpsValues) {
+            TAG_LOOKUP_MAP.put(tag.getName(), tag);
+        }
     }
 
     /**

File src/errorMessages.properties

View file
  • Ignore whitespace
 VALIDATION_EXCEEDS_LIMITS=Tag {0} has datatype {1}. The value {2} exceeds the limits of this datatype.
 VALIDATION_RAT_FOR_INT=Tag {0} has datatype {1}. The value {2} however seems to be a rational.
 VALIDATION_INVALID_TYPE=Tag {0} has datatype {1}. The value {2} could not be parsed as being such.
-IO_FILE_NOT_VALID=There was a problem reading the file {0}
+IO_FILE_NOT_VALID=There was a problem reading the file {0}
+GPS_MISSING_FIELD=Not all mandatory GPS field were provided (needs: GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude and GPSAltitudeRef)

File src/errorMessages_en.properties

View file
  • Ignore whitespace
 VALIDATION_EXCEEDS_LIMITS=Tag {0} has datatype {1}. The value {2} exceeds the limits of this datatype.
 VALIDATION_RAT_FOR_INT=Tag {0} has datatype {1}. The value {2} however seems to be a rational.
 VALIDATION_INVALID_TYPE=Tag {0} has datatype {1}. The value {2} could not be parsed as being such.
-IO_FILE_NOT_VALID=There was a problem reading the file {0}
+IO_FILE_NOT_VALID=There was a problem reading the file {0}
+GPS_MISSING_FIELD=Not all mandatory GPS field were provided (needs: GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude and GPSAltitudeRef)

File src/errorMessages_nl.properties

View file
  • Ignore whitespace
 VALIDATION_EXCEEDS_LIMITS=Tag {0} heeft datatype {1}. De waarde {2} overschrijd de limieten van dit datatype.
 VALIDATION_RAT_FOR_INT=Tag {0} heeft datatype {1}. De waarde {2} is echter rationieel.
 VALIDATION_INVALID_TYPE=Tag {0} heeft datatype {1}. De waarde {2} kon niet als zo zijnde geparsed worden.
-IO_FILE_NOT_VALID=Er was een probleem met het uitlezen van het bestand {0}
+IO_FILE_NOT_VALID=Er was een probleem met het uitlezen van het bestand {0}
+GPS_MISSING_FIELD=Niet alle verplichte GPS velden zijn gegeven (needs: GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude and GPSAltitudeRef)

File src/jexiftool.properties

View file
  • Ignore whitespace
-jexiftool.version=0.0.2
+jexiftool.version=0.0.3
 exiftool.path=lib\\exiftool.exe
 exiftool.deadlock=4000

File test/be/pw/jexif/JExifToolTest.java

View file
  • Ignore whitespace
 		assertThat(r).isNotNull().isNotEmpty();
 	}
 	
+
 	@AfterClass
 	public void afterClass() {
 	}