Skip to content

Commit

Permalink
fix jpeg quality option for jpeg files
Browse files Browse the repository at this point in the history
  • Loading branch information
kulturbande committed Feb 6, 2021
1 parent c295b66 commit 6a83906
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/alchemy/picture_variant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def encoded_image(image, options = {})

convert_format = render_format.sub("jpeg", "jpg") != picture.image_file_format.sub("jpeg", "jpg")

if render_format =~ /jpe?g/ && convert_format
if render_format =~ /jpe?g/ && (convert_format || options[:quality])
quality = options[:quality] || Config.get(:output_image_jpg_quality)
encoding_options << "-quality #{quality}"
end
Expand Down

0 comments on commit 6a83906

Please sign in to comment.