diff --git a/pom.xml b/pom.xml
index b083037..98ed63b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,167 +1,195 @@
-
- 4.0.0
- com.easyinnova
- tifflibrary4java
- 1.8.7
- jar
- Tiff Library 4 Java
- A library to read and give access to Tiff files.
- https://github.com/easyinnova/Tiff-Library-4J/
- 2015
-
- UTF-8
- UTF-8
-
-
-
- GNU General Public License, Version 3.0
- https://www.gnu.org/licenses/gpl.txt
- repo
-
-
- Mozilla Public License, Version 2.0
- https://www.mozilla.org/MPL/2.0
- repo
-
-
-
-
-
- junit
- junit-dep
- 4.8.2
- test
-
+
+ 4.0.0
+ com.easyinnova
+ tifflibrary4java
+ 1.8.7
+ jar
+ Tiff Library 4 Java
+ A library to read and give access to Tiff files.
+ https://github.com/easyinnova/Tiff-Library-4J/
+ 2015
+
+ UTF-8
+ UTF-8
+
+
+
+ GNU General Public License, Version 3.0
+ https://www.gnu.org/licenses/gpl.txt
+ repo
+
+
+ Mozilla Public License, Version 2.0
+ https://www.mozilla.org/MPL/2.0
+ repo
+
+
+
+
+
+ junit
+ junit-dep
+ 4.8.2
+ test
+
-
-
- com.adobe.xmp
- xmpcore
- 5.1.2
-
+
+
+ com.adobe.xmp
+ xmpcore
+ 5.1.2
+
-
-
- com.nmote.iim4j
- nmote-iim4j
- 1.0.0
-
-
-
-
- Víctor Muñoz Solà
- victormunoz@easyinnova.com
- Easy Innova
- http://www.easyinnova.com
-
-
-
- scm:git:git@github.com:easyinnova/Tiff-Library-4J.git
- scm:git:git@github.com:easyinnova/Tiff-Library-4J.git
- git@github.com:easyinnova/Tiff-Library-4J.git
-
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
-
-
- ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.17
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 2.4.1
-
-
-
+
+
+ com.nmote.iim4j
+ nmote-iim4j
+ 1.0.0
+
+
+
+
+ Víctor Muñoz Solà
+ victormunoz@easyinnova.com
+ Easy Innova
+ http://www.easyinnova.com
+
+
+
+ scm:git:git@github.com:easyinnova/Tiff-Library-4J.git
+ scm:git:git@github.com:easyinnova/Tiff-Library-4J.git
+
+ git@github.com:easyinnova/Tiff-Library-4J.git
+
+
+
+ ossrh
+ https://oss.sonatype.org/content/repositories/snapshots
+
+
+ ossrh
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.17
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 2.4.1
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.3
+
+
+ 1.8
+
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.3
+ true
+
+ ossrh
+ https://oss.sonatype.org/
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+
+
+
+ no-local
+
+
+ !local
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.9.1
+
+ ${basedir}/stylesheet.css
+ true
+
+ http://java.sun.com/j2se/1.5.0/docs/api/
+
+ ${basedir}/src
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.3
-
-
- 1.8
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.3
- true
-
- ossrh
- https://oss.sonatype.org/
- true
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.9.1
-
- ${basedir}/stylesheet.css
- true
-
- http://java.sun.com/j2se/1.5.0/docs/api/
-
- ${basedir}/src
-
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
diff --git a/src/main/java/com/easyinnova/tiff/io/OutputBuffer.java b/src/main/java/com/easyinnova/tiff/io/OutputBuffer.java
index d90d058..a376e5c 100644
--- a/src/main/java/com/easyinnova/tiff/io/OutputBuffer.java
+++ b/src/main/java/com/easyinnova/tiff/io/OutputBuffer.java
@@ -32,7 +32,7 @@
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.nio.ByteOrder;
+import com.easyinnova.tiff.model.ByteOrder;
/**
* The Class OutputBuffer.
diff --git a/src/main/java/com/easyinnova/tiff/io/TiffInputStream.java b/src/main/java/com/easyinnova/tiff/io/TiffInputStream.java
index 88185ce..60546a3 100644
--- a/src/main/java/com/easyinnova/tiff/io/TiffInputStream.java
+++ b/src/main/java/com/easyinnova/tiff/io/TiffInputStream.java
@@ -31,6 +31,7 @@
*/
package com.easyinnova.tiff.io;
+import com.easyinnova.tiff.model.ByteOrder;
import com.easyinnova.tiff.model.types.Ascii;
import com.easyinnova.tiff.model.types.Byte;
import com.easyinnova.tiff.model.types.Double;
@@ -48,8 +49,6 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.nio.ByteOrder;
-import java.nio.MappedByteBuffer;
/**
* The Class TiffInputStream.
diff --git a/src/main/java/com/easyinnova/tiff/io/TiffOutputStream.java b/src/main/java/com/easyinnova/tiff/io/TiffOutputStream.java
index e490bfd..a1fec35 100644
--- a/src/main/java/com/easyinnova/tiff/io/TiffOutputStream.java
+++ b/src/main/java/com/easyinnova/tiff/io/TiffOutputStream.java
@@ -41,7 +41,7 @@
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.nio.ByteOrder;
+import com.easyinnova.tiff.model.ByteOrder;
/**
* The Class TiffOutputStream.
diff --git a/src/main/java/com/easyinnova/tiff/model/ByteOrder.java b/src/main/java/com/easyinnova/tiff/model/ByteOrder.java
new file mode 100644
index 0000000..6573dda
--- /dev/null
+++ b/src/main/java/com/easyinnova/tiff/model/ByteOrder.java
@@ -0,0 +1,42 @@
+package com.easyinnova.tiff.model;
+
+import java.io.Serializable;
+
+/**
+ * Created by Adrià Llorens on 23/05/2017.
+ */
+public class ByteOrder implements Serializable {
+ private String name;
+
+ private ByteOrder(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Constant denoting big-endian byte order. In this order, the bytes of a
+ * multibyte value are ordered from most significant to least significant.
+ */
+ public static final ByteOrder BIG_ENDIAN
+ = new ByteOrder("BIG_ENDIAN");
+
+ /**
+ * Constant denoting little-endian byte order. In this order, the bytes of
+ * a multibyte value are ordered from least significant to most
+ * significant.
+ */
+ public static final ByteOrder LITTLE_ENDIAN
+ = new ByteOrder("LITTLE_ENDIAN");
+
+ /**
+ * Constructs a string describing this object.
+ *
+ *
This method returns the string "BIG_ENDIAN" for {@link
+ * #BIG_ENDIAN} and "LITTLE_ENDIAN" for {@link #LITTLE_ENDIAN}.
+ *
+ *
+ * @return The specified string
+ */
+ public String toString() {
+ return name;
+ }
+}
diff --git a/src/main/java/com/easyinnova/tiff/model/IccProfileCreator.java b/src/main/java/com/easyinnova/tiff/model/IccProfileCreator.java
index 3187d48..b64e686 100644
--- a/src/main/java/com/easyinnova/tiff/model/IccProfileCreator.java
+++ b/src/main/java/com/easyinnova/tiff/model/IccProfileCreator.java
@@ -30,10 +30,12 @@
*/
package com.easyinnova.tiff.model;
+import java.io.Serializable;
+
/**
* The Class IccProfileCreator.
*/
-public class IccProfileCreator {
+public class IccProfileCreator implements Serializable{
/** The signature. */
private int signature;
diff --git a/src/main/java/com/easyinnova/tiff/model/IfdTags.java b/src/main/java/com/easyinnova/tiff/model/IfdTags.java
index 6febd85..62398e4 100644
--- a/src/main/java/com/easyinnova/tiff/model/IfdTags.java
+++ b/src/main/java/com/easyinnova/tiff/model/IfdTags.java
@@ -33,13 +33,14 @@
import com.easyinnova.tiff.model.types.*;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Set of tags from an IFD.
*/
-public class IfdTags {
+public class IfdTags implements Serializable {
/** Tag list. */
private ArrayList tags;
diff --git a/src/main/java/com/easyinnova/tiff/model/Metadata.java b/src/main/java/com/easyinnova/tiff/model/Metadata.java
index 3452dbc..45d894c 100644
--- a/src/main/java/com/easyinnova/tiff/model/Metadata.java
+++ b/src/main/java/com/easyinnova/tiff/model/Metadata.java
@@ -30,6 +30,7 @@
*/
package com.easyinnova.tiff.model;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -38,7 +39,7 @@
/**
* A dictinary of all the metadata contained in the tiff file.
*/
-public class Metadata {
+public class Metadata implements Serializable {
/** The metadata. */
private HashMap metadata;
diff --git a/src/main/java/com/easyinnova/tiff/model/MetadataObject.java b/src/main/java/com/easyinnova/tiff/model/MetadataObject.java
index a13448b..a47b34c 100644
--- a/src/main/java/com/easyinnova/tiff/model/MetadataObject.java
+++ b/src/main/java/com/easyinnova/tiff/model/MetadataObject.java
@@ -30,13 +30,14 @@
*/
package com.easyinnova.tiff.model;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* The Class MetadataObject.
*/
-public class MetadataObject {
+public class MetadataObject implements Serializable {
/** The list. */
private List list;
diff --git a/src/main/java/com/easyinnova/tiff/model/Tag.java b/src/main/java/com/easyinnova/tiff/model/Tag.java
index 6904eae..2c2811b 100644
--- a/src/main/java/com/easyinnova/tiff/model/Tag.java
+++ b/src/main/java/com/easyinnova/tiff/model/Tag.java
@@ -68,6 +68,9 @@ public class Tag {
/** The typedef. */
private String typedef = null;
+ /** The forced description value. */
+ private String forceDescription = null;
+
/** The created. */
private Date created;
@@ -120,7 +123,10 @@ public void createValuesDictionary() {
* @param encodedValue the encoded value
* @return the tag value description
*/
- public String getTagValueDescription(String encodedValue) {
+ public String getTextDescription(String encodedValue) {
+ if (forceDescription != null) {
+ return forceDescription;
+ }
String desc = null;
if (tagValueDescriptions.containsKey(encodedValue)) {
desc = tagValueDescriptions.get(encodedValue);
@@ -128,6 +134,10 @@ public String getTagValueDescription(String encodedValue) {
return desc;
}
+ public boolean hasReadableDescription(){
+ return typedef == null;
+ }
+
public HashMap getValues() {
return tagValueDescriptions;
}
@@ -313,7 +323,7 @@ public String getTypedef() {
* @param defaultValue the default value
* @param typedef the typedef
*/
- public Tag(int id, String name, List type, String cardinality, String defaultValue, String typedef) {
+ public Tag(int id, String name, List type, String cardinality, String defaultValue, String typedef, String forceDescription) {
this.id = id;
this.name = name;
this.type = type;
@@ -327,6 +337,7 @@ public Tag(int id, String name, List type, String cardinality, String d
this.created = date;
this.modified= date;
this.typedef = typedef;
+ this.forceDescription = forceDescription;
}
public void setValues(HashMap values) {
diff --git a/src/main/java/com/easyinnova/tiff/model/TagValue.java b/src/main/java/com/easyinnova/tiff/model/TagValue.java
index 68516de..6c7d48b 100644
--- a/src/main/java/com/easyinnova/tiff/model/TagValue.java
+++ b/src/main/java/com/easyinnova/tiff/model/TagValue.java
@@ -33,17 +33,20 @@
import com.easyinnova.tiff.Constants;
import com.easyinnova.tiff.model.types.Ascii;
+import com.easyinnova.tiff.model.types.Text;
import com.easyinnova.tiff.model.types.abstractTiffType;
+import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
/**
* IFD tag object containing a list of values of a given tag type.
*/
-public class TagValue extends TiffObject {
+public class TagValue extends TiffObject implements Serializable {
/** The tag identifier. */
private int id;
@@ -52,7 +55,10 @@ public class TagValue extends TiffObject {
private int type;
/** The list of values. */
- private List value;
+ private transient List value;
+
+ /** The list of readable values. */
+ private List readValue;
/** The offset where the tag has been written. */
private int offset;
@@ -75,7 +81,8 @@ public class TagValue extends TiffObject {
public TagValue(int id, int type) {
this.id = id;
this.type = type;
- value = new ArrayList();
+ value = new ArrayList<>();
+ readValue = new ArrayList<>();
}
/**
@@ -115,15 +122,21 @@ public int getReadOffset() {
*
* @return the descriptive value
*/
- public String getDescriptiveValue() {
- String desc = this.toString();
+ public List getDescriptiveValueObject() {
Tag tag = TiffTags.getTag(id);
if (tag != null) {
- String tagDescription = tag.getTagValueDescription(toString());
- if (tagDescription != null)
- desc = tagDescription;
+ if (tag.hasReadableDescription()){
+ String desc = this.toString();
+ String tagDescription = tag.getTextDescription(toString());
+ if (tagDescription != null){
+ desc = tagDescription;
+ }
+ return Arrays.asList(new Text(desc));
+ } else {
+ return getValue();
+ }
}
- return desc;
+ return null;
}
/**
@@ -162,6 +175,24 @@ public void setValue(List value) {
this.value = value;
}
+ public List getReadValue() {
+ return readValue;
+ }
+
+ public String getFirstTextReadValue() {
+ if (readValue == null) return "";
+ for (abstractTiffType rVal : readValue){
+ if (rVal instanceof Text){
+ return rVal.toString();
+ }
+ }
+ return "";
+ }
+
+ public void setReadValue() {
+ this.readValue = getDescriptiveValueObject();
+ }
+
/**
* Adds a value to the list.
*
@@ -310,7 +341,8 @@ public void clear() {
* Reset.
*/
public void reset() {
- value = new ArrayList();
+ value = new ArrayList<>();
+ readValue = new ArrayList<>();
}
}
diff --git a/src/main/java/com/easyinnova/tiff/model/TiffDocument.java b/src/main/java/com/easyinnova/tiff/model/TiffDocument.java
index 227fdda..950dcc5 100644
--- a/src/main/java/com/easyinnova/tiff/model/TiffDocument.java
+++ b/src/main/java/com/easyinnova/tiff/model/TiffDocument.java
@@ -35,14 +35,14 @@
import com.easyinnova.tiff.model.types.IccProfile;
import com.easyinnova.tiff.model.types.abstractTiffType;
-import java.nio.ByteOrder;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Modeling of the TIFF file with methods to access its IFDs and metadata.
*/
-public class TiffDocument {
+public class TiffDocument implements Serializable {
/** The magic number. */
private int magicNumber;
diff --git a/src/main/java/com/easyinnova/tiff/model/TiffObject.java b/src/main/java/com/easyinnova/tiff/model/TiffObject.java
index 3d7935b..3000eb3 100644
--- a/src/main/java/com/easyinnova/tiff/model/TiffObject.java
+++ b/src/main/java/com/easyinnova/tiff/model/TiffObject.java
@@ -31,10 +31,12 @@
*/
package com.easyinnova.tiff.model;
+import java.io.Serializable;
+
/**
* The generic class TiffObject.
*/
-public class TiffObject {
+public class TiffObject implements Serializable {
/**
* The container element of this tiff object (EXIF, XMP, IPTC...)
diff --git a/src/main/java/com/easyinnova/tiff/model/TiffTags.java b/src/main/java/com/easyinnova/tiff/model/TiffTags.java
index c7b2c15..88c5b67 100644
--- a/src/main/java/com/easyinnova/tiff/model/TiffTags.java
+++ b/src/main/java/com/easyinnova/tiff/model/TiffTags.java
@@ -66,7 +66,7 @@ public class TiffTags {
*/
private static Tag readTagFromBuffer(BufferedReader br, boolean close) {
int id = 0;
- String name = "";
+ String name = "", forceDescription = null;
ArrayList types = new ArrayList<>();
String cardinality = "";
String defaultValue = "";
@@ -84,6 +84,9 @@ private static Tag readTagFromBuffer(BufferedReader br, boolean close) {
} else if (sCurrentLine.contains("\"name\"")) {
String sval = sCurrentLine.substring(sCurrentLine.indexOf(":") + 1).replace("\"", "").replace(",", "").trim();
name = sval;
+ } else if (sCurrentLine.contains("\"forceDescription\"")) {
+ String sval = sCurrentLine.substring(sCurrentLine.indexOf(":") + 1).replace("\"", "").replace(",", "").trim();
+ forceDescription = sval;
} else if (sCurrentLine.contains("\"cardinality\"")) {
String sval = sCurrentLine.substring(sCurrentLine.indexOf(":") + 1).replace("\"", "").replace(",", "").trim();
cardinality = sval;
@@ -119,7 +122,7 @@ private static Tag readTagFromBuffer(BufferedReader br, boolean close) {
}
}
- Tag tag = new Tag(id, name, types, cardinality, defaultValue, typedef);
+ Tag tag = new Tag(id, name, types, cardinality, defaultValue, typedef, forceDescription);
tag.createValuesDictionary();
if (valueCodes != null && valueDescriptions != null && valueCodes.length == valueDescriptions.length) {
HashMap values = new HashMap();
diff --git a/src/main/java/com/easyinnova/tiff/model/ValidationEvent.java b/src/main/java/com/easyinnova/tiff/model/ValidationEvent.java
index 5ae215f..8fd81ae 100644
--- a/src/main/java/com/easyinnova/tiff/model/ValidationEvent.java
+++ b/src/main/java/com/easyinnova/tiff/model/ValidationEvent.java
@@ -31,10 +31,12 @@
*/
package com.easyinnova.tiff.model;
+import java.io.Serializable;
+
/**
* The object that contains an error in the validation of a Tiff file.
*/
-public class ValidationEvent {
+public class ValidationEvent implements Serializable {
/** The error description. */
private String description;
diff --git a/src/main/java/com/easyinnova/tiff/model/ValidationResult.java b/src/main/java/com/easyinnova/tiff/model/ValidationResult.java
index 73f0c51..b87c5da 100644
--- a/src/main/java/com/easyinnova/tiff/model/ValidationResult.java
+++ b/src/main/java/com/easyinnova/tiff/model/ValidationResult.java
@@ -31,12 +31,13 @@
*/
package com.easyinnova.tiff.model;
+import java.io.Serializable;
import java.util.ArrayList;
/**
* Object that stores the results of the validation, errors and warnings.
*/
-public class ValidationResult {
+public class ValidationResult implements Serializable {
/** Errors List. */
public ArrayList errors;
diff --git a/src/main/java/com/easyinnova/tiff/model/types/IFD.java b/src/main/java/com/easyinnova/tiff/model/types/IFD.java
index c723d9a..7567ad6 100644
--- a/src/main/java/com/easyinnova/tiff/model/types/IFD.java
+++ b/src/main/java/com/easyinnova/tiff/model/types/IFD.java
@@ -60,10 +60,10 @@ public class IFD extends abstractTiffType {
private IFD subIFD;
/** The image strips. */
- private ImageStrips imageStrips;
+ private transient ImageStrips imageStrips;
/** The image tiles. */
- private ImageTiles imageTiles;
+ private transient ImageTiles imageTiles;
/** The is image. */
private boolean isImage;
@@ -240,6 +240,9 @@ public boolean isThumbnail() {
if (hasSubIFD() && getImageSize() < getsubIFD().getImageSize()) {
return true;
}
+ if (hasParent() && getImageSize() < getParent().getImageSize()) {
+ return true;
+ }
return false;
}
diff --git a/src/main/java/com/easyinnova/tiff/model/types/IPTC.java b/src/main/java/com/easyinnova/tiff/model/types/IPTC.java
index 291f8dd..9a7243f 100644
--- a/src/main/java/com/easyinnova/tiff/model/types/IPTC.java
+++ b/src/main/java/com/easyinnova/tiff/model/types/IPTC.java
@@ -82,21 +82,16 @@ public class IPTC extends abstractTiffType {
* The Constant SEGMENT_MARKER.
*/
public static final int[] SEGMENT_MARKER = {28, 2};
- /**
- * The validation result.
- */
- public ValidationResult validation;
/** The original value. */
private List originalValue;
- private IIMFile iimFile;
+ private transient IIMFile iimFile;
/**
* Instantiates a new IPTC.
*/
public IPTC() {
- validation = new ValidationResult(true);
}
/**
diff --git a/src/main/java/com/easyinnova/tiff/model/types/IccProfile.java b/src/main/java/com/easyinnova/tiff/model/types/IccProfile.java
index 4eb20e9..eb6c1f9 100644
--- a/src/main/java/com/easyinnova/tiff/model/types/IccProfile.java
+++ b/src/main/java/com/easyinnova/tiff/model/types/IccProfile.java
@@ -47,9 +47,6 @@ public enum ProfileClass { Input, Display, Output, DeviceLink, ColorSpace, Abstr
/** The tags. */
public IccTags tags;
- /** The validation result. */
- public ValidationResult validation;
-
/** The version. */
private String version;
diff --git a/src/main/java/com/easyinnova/tiff/model/types/IccTags.java b/src/main/java/com/easyinnova/tiff/model/types/IccTags.java
index c6e2119..cb08470 100644
--- a/src/main/java/com/easyinnova/tiff/model/types/IccTags.java
+++ b/src/main/java/com/easyinnova/tiff/model/types/IccTags.java
@@ -34,13 +34,14 @@
import com.easyinnova.tiff.model.Tag;
import com.easyinnova.tiff.model.TiffTags;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
/**
* The Class IccTags.
*/
-public class IccTags {
+public class IccTags implements Serializable {
/** Tag list. */
public ArrayList tags;
diff --git a/src/main/java/com/easyinnova/tiff/model/types/XMP.java b/src/main/java/com/easyinnova/tiff/model/types/XMP.java
index acaa6b2..3403351 100644
--- a/src/main/java/com/easyinnova/tiff/model/types/XMP.java
+++ b/src/main/java/com/easyinnova/tiff/model/types/XMP.java
@@ -34,8 +34,6 @@
import com.adobe.xmp.XMPIterator;
import com.adobe.xmp.XMPMeta;
import com.adobe.xmp.XMPMetaFactory;
-import com.adobe.xmp.XMPSchemaRegistry;
-import com.adobe.xmp.impl.XMPIteratorImpl;
import com.adobe.xmp.options.SerializeOptions;
import com.adobe.xmp.properties.XMPPropertyInfo;
import com.easyinnova.tiff.io.TiffOutputStream;
@@ -46,7 +44,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.w3c.dom.traversal.DocumentTraversal;
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.traversal.NodeIterator;
@@ -62,11 +59,8 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
@@ -76,7 +70,7 @@
* The Class XMP.
*/
public class XMP extends XmlType {
- private XMPMeta xmpMeta;
+ private transient XMPMeta xmpMeta;
/** The metadata. */
private Metadata metadata;
diff --git a/src/main/java/com/easyinnova/tiff/model/types/XmlType.java b/src/main/java/com/easyinnova/tiff/model/types/XmlType.java
index cf89e37..cb4b571 100644
--- a/src/main/java/com/easyinnova/tiff/model/types/XmlType.java
+++ b/src/main/java/com/easyinnova/tiff/model/types/XmlType.java
@@ -34,16 +34,14 @@
import java.io.StringReader;
-import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
/**
* The Class XmlType.
*/
public class XmlType extends abstractTiffType {
/** The xml model. */
- protected StringReader xmlReader;
+ protected transient StringReader xmlReader;
/**
* The xml.
*/
diff --git a/src/main/java/com/easyinnova/tiff/model/types/abstractTiffType.java b/src/main/java/com/easyinnova/tiff/model/types/abstractTiffType.java
index bf7376e..29caedd 100644
--- a/src/main/java/com/easyinnova/tiff/model/types/abstractTiffType.java
+++ b/src/main/java/com/easyinnova/tiff/model/types/abstractTiffType.java
@@ -35,10 +35,12 @@
import com.easyinnova.tiff.model.TagValue;
import com.easyinnova.tiff.model.TiffObject;
+import java.io.Serializable;
+
/**
* The generic class abstractTiffType.
*/
-public class abstractTiffType extends TiffObject {
+public class abstractTiffType extends TiffObject implements Serializable {
/** The tag size in bytes. */
private int typeSize;
diff --git a/src/main/java/com/easyinnova/tiff/reader/TiffReader.java b/src/main/java/com/easyinnova/tiff/reader/TiffReader.java
index d356409..c2db157 100644
--- a/src/main/java/com/easyinnova/tiff/reader/TiffReader.java
+++ b/src/main/java/com/easyinnova/tiff/reader/TiffReader.java
@@ -32,6 +32,7 @@
package com.easyinnova.tiff.reader;
import com.easyinnova.tiff.io.TiffInputStream;
+import com.easyinnova.tiff.model.ByteOrder;
import com.easyinnova.tiff.model.IccProfileCreators;
import com.easyinnova.tiff.model.ReadIccConfigIOException;
import com.easyinnova.tiff.model.ReadTagsIOException;
@@ -42,16 +43,12 @@
import com.easyinnova.tiff.model.ValidationResult;
import com.easyinnova.tiff.model.types.IFD;
import com.easyinnova.tiff.model.types.abstractTiffType;
-import com.easyinnova.tiff.model.types.IPTC;
import com.easyinnova.tiff.profiles.BaselineProfile;
import com.easyinnova.tiff.profiles.TiffEPProfile;
import com.easyinnova.tiff.profiles.TiffITProfile;
-import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileWriter;
import java.lang.reflect.InvocationTargetException;
-import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashSet;
@@ -620,6 +617,7 @@ protected TagValue getValue(int tagtype, int n, int id, int beginOffset, IFD par
}
}
+ if (ok) tv.setReadValue();
return tv;
}
}
diff --git a/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java b/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java
index 5c409d0..69f2852 100644
--- a/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java
+++ b/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java
@@ -51,7 +51,7 @@
import com.easyinnova.tiff.model.types.abstractTiffType;
import java.io.IOException;
-import java.nio.ByteOrder;
+import com.easyinnova.tiff.model.ByteOrder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
diff --git a/src/main/resources/tifftags/ImageSourceData.json b/src/main/resources/tifftags/ImageSourceData.json
index dd39b07..ca6d0a4 100644
--- a/src/main/resources/tifftags/ImageSourceData.json
+++ b/src/main/resources/tifftags/ImageSourceData.json
@@ -10,5 +10,6 @@
"description": "",
"source": "",
"created": "18/05/2015",
- "modified": "18/05/2015"
+ "modified": "18/05/2015",
+ "forceDescription": ""
}
\ No newline at end of file
diff --git a/src/main/resources/tifftags/SubIFDs.json b/src/main/resources/tifftags/SubIFDs.json
index 744becf..09fe70f 100644
--- a/src/main/resources/tifftags/SubIFDs.json
+++ b/src/main/resources/tifftags/SubIFDs.json
@@ -5,6 +5,7 @@
"LONG",
"IFD"
],
+ "typedef": "IFD",
"cardinality": "N",
"defaultValue": "",
"ifd": "",
diff --git a/src/main/resources/tifftags/XMP.json b/src/main/resources/tifftags/XMP.json
index 100ae7a..371378a 100644
--- a/src/main/resources/tifftags/XMP.json
+++ b/src/main/resources/tifftags/XMP.json
@@ -5,7 +5,7 @@
"BYTE",
"UNDEFINED"
],
- "typedef": XMP,
+ "typedef": "XMP",
"cardinality": "N",
"defaultValue": "",
"ifd": "",
diff --git a/src/test/java/com/easyinnova/tiff/IPTCTest.java b/src/test/java/com/easyinnova/tiff/IPTCTest.java
index 2b08e05..8b9bfa6 100644
--- a/src/test/java/com/easyinnova/tiff/IPTCTest.java
+++ b/src/test/java/com/easyinnova/tiff/IPTCTest.java
@@ -13,7 +13,7 @@
import org.junit.Test;
import java.io.File;
-import java.nio.ByteOrder;
+import com.easyinnova.tiff.model.ByteOrder;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
diff --git a/src/test/java/com/easyinnova/tiff/XMPTest.java b/src/test/java/com/easyinnova/tiff/XMPTest.java
index 422c0a3..4b97517 100644
--- a/src/test/java/com/easyinnova/tiff/XMPTest.java
+++ b/src/test/java/com/easyinnova/tiff/XMPTest.java
@@ -14,7 +14,7 @@
import org.junit.Test;
import java.io.File;
-import java.nio.ByteOrder;
+import com.easyinnova.tiff.model.ByteOrder;
/**
* Created by easy on 05/10/2016.
diff --git a/src/test/java/com/easyinnova/tiff/io/TiffFileInputStreamTest.java b/src/test/java/com/easyinnova/tiff/io/TiffFileInputStreamTest.java
index 803e5ea..e2d616d 100644
--- a/src/test/java/com/easyinnova/tiff/io/TiffFileInputStreamTest.java
+++ b/src/test/java/com/easyinnova/tiff/io/TiffFileInputStreamTest.java
@@ -29,7 +29,7 @@
import java.io.File;
import java.io.IOException;
-import java.nio.ByteOrder;
+import com.easyinnova.tiff.model.ByteOrder;
/**
* The Class TiffFileInputStreamTest.
diff --git a/src/test/java/com/easyinnova/tiff/io/TiffWriterTest.java b/src/test/java/com/easyinnova/tiff/io/TiffWriterTest.java
index 64562ec..8a5b1ac 100644
--- a/src/test/java/com/easyinnova/tiff/io/TiffWriterTest.java
+++ b/src/test/java/com/easyinnova/tiff/io/TiffWriterTest.java
@@ -29,7 +29,7 @@
import org.junit.Test;
import java.io.File;
-import java.nio.ByteOrder;
+import com.easyinnova.tiff.model.ByteOrder;
/**
* Testing class.
diff --git a/tifflibrary4java.iml b/tifflibrary4java.iml
index 682e048..dbfc6ba 100644
--- a/tifflibrary4java.iml
+++ b/tifflibrary4java.iml
@@ -10,7 +10,7 @@
-
+