CompressOptions class

Options for image compression.

Defines the maximum dimensions and quality for image compression.

  • maxWidth and maxHeight are optional; if null, no dimension limit is applied.
  • quality is clamped to the range 0-100 (default: 70).
    • For JPEG: controls compression quality (0 = lowest, 100 = highest).
    • For PNG: ignored (PNG is lossless, only resizing is applied).
Annotations

Constructors

CompressOptions({int? maxWidth, int? maxHeight, int quality = 70})
Creates compression options with optional dimension limits and quality.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
maxHeight int?
Maximum height in pixels. If null, height is unlimited.
final
maxWidth int?
Maximum width in pixels. If null, width is unlimited.
final
quality int
Compression quality (0-100). Default is 70.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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