You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My use case involves using animated gifs. When a format is specified in show_alchemy_picture_path, it tries to converted the gif to an jpg. When dragonfly calls the 'convert' method on a gif to a jpg, it generates 1 jpg per frame, causing a massive slowdown and in the end the picture is not shown (not sure why now, maybe because the filename is different now, appended with the frame number).
The correct call would be convert 'images.gif[0]' image.png or convert -flatten images.gif image.png
The thumbnails in the admin, are stripped of their extension in
To fix generating multiple frames, I hooked into the alchemy/pictures_controller.rb#send_image method
def send_image(image, format)
request.session_options[:skip] = true
ALLOWED_IMAGE_TYPES.each do |type|
format.send(type) do
options = []
if type == 'jpeg'
quality = params[:quality] || Config.get(:output_image_jpg_quality)
options << "-quality #{quality}"
end
# Flatten gif sequence when converting to a different type
if type != "gif" && image.ext == 'gif'
options << "-flatten"
end
render text: image.encode(type, options.join(' ')).data
end
end
end
The text was updated successfully, but these errors were encountered:
Confirm that displaying animated gifs are broken. Will provide a pull request that fixes that in the way that all thumbnails will get converted correctly into the target format.
But, I will not change the thumbnail format, because one does not want to really see the animation inside the thumbnail.
This would be visually distracting. The zoomed image in the library overlay should display the image in original format, so one can preview the animation if they prefer.
Thanks for your pictures controller fix, I will use that in my PR.
My use case involves using animated gifs. When a format is specified in show_alchemy_picture_path, it tries to converted the gif to an jpg. When dragonfly calls the 'convert' method on a gif to a jpg, it generates 1 jpg per frame, causing a massive slowdown and in the end the picture is not shown (not sure why now, maybe because the filename is different now, appended with the frame number).
The correct call would be
convert 'images.gif[0]' image.png
orconvert -flatten images.gif image.png
The thumbnails in the admin, are stripped of their extension in
alchemy_cms/app/helpers/alchemy/admin/essences_helper.rb
Line 74 in 0f90048
So it always uses the default format of png defined in routes. This would fix it:
But this happens in various places, and not every view uses this helper
alchemy_cms/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb
Line 11 in 81dbe18
alchemy_cms/app/views/alchemy/admin/pictures/_picture.html.erb
Line 70 in 81dbe18
To fix generating multiple frames, I hooked into the alchemy/pictures_controller.rb#send_image method
The text was updated successfully, but these errors were encountered: