Package gov.nih.mipav.model.file
Class MetadataExtractor.PngMetadataReader
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.PngMetadataReader
-
- Enclosing class:
- MetadataExtractor
public class MetadataExtractor.PngMetadataReader extends java.lang.Object
- Author:
- Drew Noakes https://drewnoakes.com
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<MetadataExtractor.PngChunkType>
_desiredChunkTypes
private java.nio.charset.Charset
_latin1Encoding
(package private) MetadataExtractor.Charsets
ch
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) 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 Instance Methods Concrete Methods Modifier and Type Method Description private void
processChunk(MetadataExtractor.Metadata metadata, MetadataExtractor.PngChunk chunk)
MetadataExtractor.Metadata
readMetadata(java.io.File file)
MetadataExtractor.Metadata
readMetadata(java.io.InputStream inputStream)
-
-
-
Field Detail
-
_desiredChunkTypes
private java.util.Set<MetadataExtractor.PngChunkType> _desiredChunkTypes
-
ch
MetadataExtractor.Charsets ch
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)
-
_latin1Encoding
private java.nio.charset.Charset _latin1Encoding
-
-
Method Detail
-
readMetadata
public MetadataExtractor.Metadata readMetadata(java.io.File file) throws MetadataExtractor.PngProcessingException, java.io.IOException
- Throws:
MetadataExtractor.PngProcessingException
java.io.IOException
-
readMetadata
public MetadataExtractor.Metadata readMetadata(java.io.InputStream inputStream) throws MetadataExtractor.PngProcessingException, java.io.IOException
- Throws:
MetadataExtractor.PngProcessingException
java.io.IOException
-
processChunk
private void processChunk(MetadataExtractor.Metadata metadata, MetadataExtractor.PngChunk chunk) throws MetadataExtractor.PngProcessingException, java.io.IOException
- Throws:
MetadataExtractor.PngProcessingException
java.io.IOException
-
-