ImageCompressorOptions class

Constructors

ImageCompressorOptions({required int targetSizeInKB, int initialQuality = 92, int minQuality = 40, int step = 4, int? maxWidth, int? maxHeight, CompressFormat format = CompressFormat.jpeg, bool keepExif = false, double earlyStopRatio = 0.95, double nearTargetFactor = 1.2, int preferredMinQuality = 80, int maxAttemptsPerDim = 5, int maxTotalTrials = 24})
const

Properties

earlyStopRatio → double
早停命中带下界比例,命中条件:earlyStopRatio * target, target
final
format → CompressFormat
压缩格式
final
hashCode → int
The hash code for this object.
no setterinherited
initialQuality → int
初始质量,0-100
final
keepExif → bool
EXIF 信息:默认情况下,压缩后的图片不会保留原始图片的 EXIF 信息(如拍摄参数、GPS 位置等)。 如果需要保留,可以将 keepExif 参数设为 true,但请注意此选项仅对 JPG 格式有效,且不会保留方向信息
final
maxAttemptsPerDim → int
每个维度/区间的最大尝试次数
final
maxHeight → int?
最大高度,0-无限
final
maxTotalTrials → int
全流程的最大尝试次数
final
maxWidth → int?
最大宽度,0-无限
final
minQuality → int
最小质量,0-100
final
nearTargetFactor → double
小偏差快速路径触发因子:原图 ≤ nearTargetFactor * target 时启用
final
preferredMinQuality → int
小偏差路径下的最低质量下限
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
step → int
质量步长,0-100
final
targetSizeInKB → int
目标大小,单位:KB
final

Methods

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

Operators

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