ImageCompressorWeb class

Web backend: encodes in-browser via OffscreenCanvas.convertToBlob. No pica script tag, no extra deps — the differentiator vs flutter_image_compress on web. HEIC cannot be encoded in a browser and returns UnsupportedFormatError.

Inheritance

Constructors

ImageCompressorWeb()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

encodeOnce(EncodeRequest request) Future<EncodeResult>
Encode request exactly once and return the resulting bytes plus decoded dimensions. Backends must decode at a reduced size when maxWidth/ maxHeight are set (downsample-on-decode) to avoid loading huge bitmaps into memory.
override
encodeToSize(EncodeSizeRequest request) Future<EncodeResult>
Decode request once, then binary-search quality down to minQuality until the output fits under maxBytes. Returns the best fitting result, or (if nothing fits) the smallest achievable with reachedTarget false.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
probeSize(Uint8List bytes) Future<(int, int)>
Read just the pixel dimensions of bytes from the image header, without decoding the pixels. Returns (width, height).
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

registerWith(Registrar registrar) → void