Package com.drew.imaging.png
Class PngMetadataReader
- java.lang.Object
-
- com.drew.imaging.png.PngMetadataReader
-
public class PngMetadataReader extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Set<PngChunkType>_desiredChunkTypesprivate static java.nio.charset.Charset_latin1EncodingThe 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 Constructor Description PngMetadataReader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidprocessChunk(Metadata metadata, PngChunk chunk)static MetadatareadMetadata(java.io.File file)static MetadatareadMetadata(java.io.InputStream inputStream)
-
-
-
Field Detail
-
_desiredChunkTypes
private static java.util.Set<PngChunkType> _desiredChunkTypes
-
_latin1Encoding
private static java.nio.charset.Charset _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)
-
-
Method Detail
-
readMetadata
public static Metadata readMetadata(java.io.File file) throws PngProcessingException, java.io.IOException
- Throws:
PngProcessingExceptionjava.io.IOException
-
readMetadata
public static Metadata readMetadata(java.io.InputStream inputStream) throws PngProcessingException, java.io.IOException
- Throws:
PngProcessingExceptionjava.io.IOException
-
processChunk
private static void processChunk(Metadata metadata, PngChunk chunk) throws PngProcessingException, java.io.IOException
- Throws:
PngProcessingExceptionjava.io.IOException
-
-