Skip to content

Commit

Permalink
Merge pull request #587 from andreakb/integration
Browse files Browse the repository at this point in the history
Udpate PngModule.java
  • Loading branch information
carlwilson authored May 6, 2020
2 parents 9313456 + 9d64d8b commit 8220f49
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions extramodules/it/eng/jhove/module/png/PngModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ public class PngModule extends ModuleBase {
"PNG Truecolor", // 2
"PNG Indexed", // 3
"PNG GrayScale with Alpha", // 4
"Unused", // 5
"PNG Truecolor with Alpha"}; // 6
"PNG Truecolor with Alpha"}; // 5

public static final boolean PNG_ENDIANITY=true;

Expand Down Expand Up @@ -379,7 +378,7 @@ public final int parse(final InputStream inputStream,
IdentifierType.URL));
_specification.add (doc);

Signature sig = new InternalSignature ("PNG", SignatureType.MAGIC,
Signature sig = new InternalSignature (FORMAT[0], SignatureType.MAGIC,
SignatureUseType.MANDATORY, 0);
_signature.add (sig);

Expand All @@ -394,7 +393,7 @@ public final int parse(final InputStream inputStream,
repInfo.setWellFormed (RepInfo.FALSE);
return 0;
}
repInfo.setFormat("PNG");
repInfo.setFormat(FORMAT[0]);

// If we got this far, take note that the signature is OK.
repInfo.setSigMatch(_name);
Expand Down Expand Up @@ -961,7 +960,7 @@ private final void checkIHDR(final DataInputStream inputStream,
colorType + ": " +tmp ));

}
repInfo.setProfile("PNG GrayScale");
repInfo.setProfile(PNG_PROFILES[0]);

expectingPLTE=RepInfo.FALSE;
case EachPixel_PALETTE:
Expand All @@ -978,7 +977,7 @@ private final void checkIHDR(final DataInputStream inputStream,
expectingPLTE = RepInfo.TRUE;
colorDepth = tmp;
maxPaletteSize = 1 << tmp ;
repInfo.setProfile("PNG Indexed");
repInfo.setProfile(PNG_PROFILES[3]);

break;
case EachPixel_GRAYSCALE_ALPHA:
Expand All @@ -991,7 +990,7 @@ private final void checkIHDR(final DataInputStream inputStream,

}

repInfo.setProfile("PNG GrayScale with Alpha");
repInfo.setProfile(PNG_PROFILES[4]);
break;
case EachPixel_RGB_ALPHA:
expectingPLTE=RepInfo.FALSE;
Expand All @@ -1003,7 +1002,7 @@ private final void checkIHDR(final DataInputStream inputStream,
colorType + ": " +tmp ));

}
repInfo.setProfile("PNG Truecolor with Alpha");
repInfo.setProfile(PNG_PROFILES[5]);
break;
case EachPixel_RGB:
expectingPLTE=RepInfo.FALSE;
Expand All @@ -1016,7 +1015,7 @@ private final void checkIHDR(final DataInputStream inputStream,

}

repInfo.setProfile("PNG Truecolor");
repInfo.setProfile(PNG_PROFILES[2]);
break;
default:
repInfo.setValid(RepInfo.FALSE);
Expand Down

0 comments on commit 8220f49

Please sign in to comment.