OptimizationSettings.fromYaml constructor

OptimizationSettings.fromYaml(
  1. YamlMap yaml
)

Implementation

factory OptimizationSettings.fromYaml(YamlMap yaml) {
  return OptimizationSettings(
    jpegQuality: yaml['jpeg_quality'] as int? ?? 85,
    webpQuality: yaml['webp_quality'] as int? ?? 80,
    stripMetadata: yaml['strip_metadata'] as bool? ?? true,
    convertPngToWebp: yaml['convert_png_to_webp'] as bool? ?? true,
  );
}