Skip to content

WebpResourceAnimationReader

class WebpResourceAnimationReader
Implements: IResourceAnimationReader
Package: dev.joid.lib.resource.animation.impl · Module: core · Source: WebpResourceAnimationReader.java

Reads the frames of an animated WebP.

A frame duration of 10 ms or less shows for 100 ms.

ReturnsSignatureSummary
WebpResourceAnimationReader()Creates the reader.

ReturnsSignatureSummary
ResourceAnimationread(InputStream stream)Reads every frame of the WebP, composed with its blend and disposal, and its play count.
booleanisWebp(byte[] bytes) staticIf true, bytes start with a RIFF header of type WEBP.
booleanisAnimated(byte[] bytes) staticIf true, bytes are a WebP whose extended header has the animation flag.

WebpResourceAnimationReader()

Creates the reader.

ResourceAnimation read(InputStream stream)

Throws:

  • IllegalArgumentException: The file does not start with a RIFF WEBP header, it is not a WebP image: check the file and its extension
  • IllegalArgumentException: The WebP chunk … runs past the end of the file, the file is damaged: export it again
  • IllegalArgumentException: The WebP has no ANMF frame or no VP8X size, it is not an animated WebP: draw it as a still image or export it with its animation

Reads every frame of the WebP, composed with its blend and disposal, and its play count. Throws IllegalArgumentException when the file is not a WebP, has no animation frame, or holds a chunk that runs past its end.

boolean isWebp(byte[] bytes) static

If true, bytes start with a RIFF header of type WEBP.

boolean isAnimated(byte[] bytes) static

If true, bytes are a WebP whose extended header has the animation flag.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page