Skip to content

Commit

Permalink
Added tag descriptions EasyinnovaSL#50
Browse files Browse the repository at this point in the history
  • Loading branch information
victormunoz committed Jun 2, 2017
1 parent 962cf1f commit c4582dd
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.easyinnova</groupId>
<artifactId>tifflibrary4java</artifactId>
<version>1.9</version>
<version>1.9.1</version>
<packaging>jar</packaging>
<name>Tiff Library 4 Java</name>
<description>A library to read and give access to Tiff files.</description>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/easyinnova/tiff/model/TiffTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private static Tag readTagFromBuffer(BufferedReader br, boolean close) {
String cardinality = "";
String defaultValue = "";
String typedef = null;
String description = null;
String[] valueCodes = null;
String[] valueDescriptions = null;

Expand All @@ -96,6 +97,9 @@ private static Tag readTagFromBuffer(BufferedReader br, boolean close) {
} else if (sCurrentLine.contains("\"valueCodes\"")) {
sCurrentLine = br.readLine();
valueCodes = sCurrentLine.split(",");
} else if (sCurrentLine.contains("\"description\"")) {
sCurrentLine = br.readLine();
description = sCurrentLine.substring(sCurrentLine.indexOf(":") + 1).replace("\"", "").replace(",", "").trim();
} else if (sCurrentLine.contains("\"valueDescriptions\"")) {
sCurrentLine = br.readLine();
valueDescriptions = sCurrentLine.split(",");
Expand Down Expand Up @@ -123,6 +127,7 @@ private static Tag readTagFromBuffer(BufferedReader br, boolean close) {
}

Tag tag = new Tag(id, name, types, cardinality, defaultValue, typedef, forceDescription);
tag.setDescription(description);
tag.createValuesDictionary();
if (valueCodes != null && valueDescriptions != null && valueCodes.length == valueDescriptions.length) {
HashMap<String, String> values = new HashMap<String, String>();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/tifftags/Compression.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cardinality": "1",
"defaultValue": "1",
"ifd": "",
"description": "",
"description": "Compression scheme",
"source": "",
"created": "18/05/2015",
"modified": "18/05/2015",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/tifftags/ImageLength.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cardinality": "1",
"defaultValue": "",
"ifd": "",
"description": "",
"description": "Image Height (in pixels)",
"source": "",
"created": "18/05/2015",
"modified": "18/05/2015"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/tifftags/ImageWidth.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cardinality": "1",
"defaultValue": "",
"ifd": "",
"description": "",
"description": "Image Width (in pixels)",
"source": "",
"created": "18/05/2015",
"modified": "18/05/2015"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/tifftags/PhotometricInterpretation.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cardinality": "1",
"defaultValue": "",
"ifd": "",
"description": "",
"description": "Color space of the image data",
"source": "",
"created": "18/05/2015",
"modified": "18/05/2015",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/tifftags/PlanarConfiguration.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cardinality": "1",
"defaultValue": "1",
"ifd": "",
"description": "",
"description": "How the pixels components are stored (Chunky=Pixel components stored contiguously, Planar=Separate component planes)",
"source": "",
"created": "18/05/2015",
"modified": "18/05/2015",
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/easyinnova/tiff/TiffMetadataTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void Test1() {

assertEquals("ASCII??? ", to.getMetadataSingleString("UserComment"));
//assertEquals("[28,1,90,0,3,27,37,71,28,1,90,0,3,27,37,71,28,2,0,0,2,0,0,28,2,80,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,28,2,55,0,8,50,48,49,48,48,53,50,52,28,2,60,0,11,49,51,53,55,49,53,43,48,48,48,48,28,2,116,0,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]", to.getMetadataSingleString("IPTC"));
assertEquals("023", to.getMetadataSingleString("36864"));
assertEquals("023", to.getMetadataSingleString("ExifVersion"));
}

/**
Expand Down

0 comments on commit c4582dd

Please sign in to comment.