Package com.drew.metadata.webp
Class WebpRiffHandler
java.lang.Object
com.drew.metadata.webp.WebpRiffHandler
- All Implemented Interfaces:
RiffHandler
Implementation of
RiffHandler specialising in WebP support.
Extracts data from chunk types:
"VP8X": width, height, is animation, has alpha"EXIF": full Exif data"ICCP": full ICC profile"XMP ": full XMP data
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters an error message for consumption after extraction.voidprocessChunk(String fourCC, byte[] payload) Perform whatever processing is necessary for the type of chunk with its payload.booleanshouldAcceptChunk(String fourCC) Gets whether this handler is interested in the specific chunk type.booleanshouldAcceptList(String fourCC) Gets whether this handler is interested in the specific list type.booleanshouldAcceptRiffIdentifier(String identifier) Gets whether the specified RIFF identifier is of interest to this handler.
-
Constructor Details
-
WebpRiffHandler
-
-
Method Details
-
shouldAcceptRiffIdentifier
Description copied from interface:RiffHandlerGets whether the specified RIFF identifier is of interest to this handler. Returningfalsecauses processing to stop after reading only the first twelve bytes of data.- Specified by:
shouldAcceptRiffIdentifierin interfaceRiffHandler- Parameters:
identifier- The four character code identifying the type of RIFF data- Returns:
- true if processing should continue, otherwise false
-
shouldAcceptChunk
Description copied from interface:RiffHandlerGets whether this handler is interested in the specific chunk type. Returnstrueif the data should be copied into an array and passed toRiffHandler.processChunk(String, byte[]), orfalseto avoid the copy and skip to the next chunk in the file, if any.- Specified by:
shouldAcceptChunkin interfaceRiffHandler- Parameters:
fourCC- the four character code of this chunk- Returns:
- true if
RiffHandler.processChunk(String, byte[])should be called, otherwise false
-
shouldAcceptList
Description copied from interface:RiffHandlerGets whether this handler is interested in the specific list type. Returnstrueif the chunks should continue being processed, orfalseto avoid any unknown chunks within the list.- Specified by:
shouldAcceptListin interfaceRiffHandler- Parameters:
fourCC- the four character code of this chunk- Returns:
- true if
RiffHandler.processChunk(String, byte[])should be called, otherwise false
-
processChunk
Description copied from interface:RiffHandlerPerform whatever processing is necessary for the type of chunk with its payload. This is only called if a previous call toRiffHandler.shouldAcceptChunk(String)with the samefourCCreturnedtrue.- Specified by:
processChunkin interfaceRiffHandler- Parameters:
fourCC- the four character code of the chunkpayload- they payload of the chunk as a byte array
-
addError
Description copied from interface:RiffHandlerRegisters an error message for consumption after extraction.- Specified by:
addErrorin interfaceRiffHandler- Parameters:
message- the error message
-