Package com.drew.metadata.webp
Class WebpRiffHandler
- java.lang.Object
-
- com.drew.metadata.webp.WebpRiffHandler
-
- All Implemented Interfaces:
RiffHandler
public class WebpRiffHandler extends java.lang.Object implements RiffHandler
Implementation ofRiffHandlerspecialising 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 Constructor Description WebpRiffHandler(Metadata metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(java.lang.String message)Registers an error message for consumption after extraction.voidprocessChunk(java.lang.String fourCC, byte[] payload)Perform whatever processing is necessary for the type of chunk with its payload.booleanshouldAcceptChunk(java.lang.String fourCC)Gets whether this handler is interested in the specific chunk type.booleanshouldAcceptList(java.lang.String fourCC)Gets whether this handler is interested in the specific list type.booleanshouldAcceptRiffIdentifier(java.lang.String identifier)Gets whether the specified RIFF identifier is of interest to this handler.
-
-
-
Field Detail
-
_metadata
private final Metadata _metadata
-
-
Constructor Detail
-
WebpRiffHandler
public WebpRiffHandler(Metadata metadata)
-
-
Method Detail
-
shouldAcceptRiffIdentifier
public boolean shouldAcceptRiffIdentifier(java.lang.String identifier)
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
public boolean shouldAcceptChunk(java.lang.String fourCC)
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
public boolean shouldAcceptList(java.lang.String fourCC)
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
public void processChunk(java.lang.String fourCC, byte[] payload)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
public void addError(java.lang.String message)
Description copied from interface:RiffHandlerRegisters an error message for consumption after extraction.- Specified by:
addErrorin interfaceRiffHandler- Parameters:
message- the error message
-
-