Package com.drew.imaging.png
Class PngMetadataReader
java.lang.Object
com.drew.imaging.png.PngMetadataReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Set<PngChunkType>private static CharsetThe PNG spec states that ISO_8859_1 (Latin-1) encoding should be used for: "tEXt" and "zTXt" chunks, both for keys and values (https://www.w3.org/TR/PNG/#11tEXt) "iCCP" chunks, for the profile name (https://www.w3.org/TR/PNG/#11iCCP) "sPLT" chunks, for the palette name (https://www.w3.org/TR/PNG/#11sPLT) Note that "iTXt" chunks use UTF-8 encoding (https://www.w3.org/TR/PNG/#11iTXt). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidprocessChunk(Metadata metadata, PngChunk chunk) static MetadatareadMetadata(File file) static MetadatareadMetadata(InputStream inputStream)
-
Field Details
-
_desiredChunkTypes
-
_latin1Encoding
The PNG spec states that ISO_8859_1 (Latin-1) encoding should be used for:- "tEXt" and "zTXt" chunks, both for keys and values (https://www.w3.org/TR/PNG/#11tEXt)
- "iCCP" chunks, for the profile name (https://www.w3.org/TR/PNG/#11iCCP)
- "sPLT" chunks, for the palette name (https://www.w3.org/TR/PNG/#11sPLT)
-
-
Constructor Details
-
PngMetadataReader
public PngMetadataReader()
-
-
Method Details
-
readMetadata
- Throws:
PngProcessingExceptionIOException
-
readMetadata
public static Metadata readMetadata(InputStream inputStream) throws PngProcessingException, IOException - Throws:
PngProcessingExceptionIOException
-
processChunk
private static void processChunk(Metadata metadata, PngChunk chunk) throws PngProcessingException, IOException - Throws:
PngProcessingExceptionIOException
-