public class WebpRiffHandler extends Object implements RiffHandler
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 dataConstructor and Description |
---|
WebpRiffHandler(Metadata metadata) |
Modifier and Type | Method and Description |
---|---|
void |
addError(String message)
Registers an error message for consumption after extraction.
|
void |
processChunk(String fourCC,
byte[] payload)
Perform whatever processing is necessary for the type of chunk with its
payload.
|
boolean |
shouldAcceptChunk(String fourCC)
Gets whether this handler is interested in the specific chunk type.
|
boolean |
shouldAcceptList(String fourCC)
Gets whether this handler is interested in the specific list type.
|
boolean |
shouldAcceptRiffIdentifier(String identifier)
Gets whether the specified RIFF identifier is of interest to this handler.
|
public WebpRiffHandler(Metadata metadata)
public boolean shouldAcceptRiffIdentifier(String identifier)
RiffHandler
false
causes processing to stop after reading only
the first twelve bytes of data.shouldAcceptRiffIdentifier
in interface RiffHandler
identifier
- The four character code identifying the type of RIFF datapublic boolean shouldAcceptChunk(String fourCC)
RiffHandler
true
if the data should be copied into an array and passed
to RiffHandler.processChunk(String, byte[])
, or false
to avoid
the copy and skip to the next chunk in the file, if any.shouldAcceptChunk
in interface RiffHandler
fourCC
- the four character code of this chunkRiffHandler.processChunk(String, byte[])
should be called, otherwise falsepublic boolean shouldAcceptList(String fourCC)
RiffHandler
true
if the chunks should continue being processed,
or false
to avoid any unknown chunks within the list.shouldAcceptList
in interface RiffHandler
fourCC
- the four character code of this chunkRiffHandler.processChunk(String, byte[])
should be called, otherwise falsepublic void processChunk(String fourCC, byte[] payload)
RiffHandler
RiffHandler.shouldAcceptChunk(String)
with the same fourCC
returned true
.processChunk
in interface RiffHandler
fourCC
- the four character code of the chunkpayload
- they payload of the chunk as a byte arraypublic void addError(String message)
RiffHandler
addError
in interface RiffHandler
message
- the error messageCopyright © 2002-2020 Drew Noakes. All Rights Reserved.