Skip to content

Commit

Permalink
fix: Fix the default value for heic_speed to 8 and make it variable i…
Browse files Browse the repository at this point in the history
…n the config file
  • Loading branch information
sadok-f committed Feb 18, 2024
1 parent edc9c4a commit 25e7cdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion config/parameters.yml
Expand Up @@ -22,7 +22,7 @@ whitelist_domains:
- domain-1.com
- domain-2.com

# Default storage system is local, to use use AWS S3, change this param to s3
# Default storage system is local, to use AWS S3, change this param to s3
storage_system: local

# In case storage_system: s3, you need to add those AWS S3 parameters:
Expand All @@ -35,6 +35,9 @@ aws_s3:
# Number of threads for Imagemagick to use
thread: 1

# For Avif format: conversion speed parameter for the HEIF library.
heic_speed: 8

# Read source image timeout in seconds
source_image_request_timeout: 5

Expand Down
3 changes: 2 additions & 1 deletion src/Core/Processor/ImageProcessor.php
Expand Up @@ -191,7 +191,8 @@ protected function calculateQuality(OutputImage $outputImage): string
$quality = $outputImage->extractKey('quality');

if ($outputImage->isOutputAvif()) {
$parameter = "-define heic:speed=2 -quality " . escapeshellarg($quality) .
$heicSpeed = $outputImage->getInputImage()->optionsBag()->appParameters()->parameterByKey('heic_speed');
$parameter = "-define heic:speed=".$heicSpeed." -quality " . escapeshellarg($quality) .
" " . escapeshellarg($outputImage->getOutputTmpPath());
} elseif (is_executable(self::CWEBP_COMMAND) && $outputImage->isOutputWebP()) {
$lossLess = $outputImage->extractKey('webp-lossless') ? 'true' : 'false';
Expand Down

0 comments on commit 25e7cdd

Please sign in to comment.