-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
SVGs are not handled by thumbnail processor correctly #1564
Comments
I think I've stumbled on the same bug. @gustavoguimaraes could you please share with me your workaround? |
I'm having a similar problem...anyone out there find a solution/workaround? Thanks. |
Hi everybody! Is this still an issue for you in Paperclip; I know this issue is from approximately 1 year ago. If it is still an issue, can you please provide the code that's causing you the error? Thanks! |
It came up in a client's project recently. I'll see if I can dig up a code example, but this is pretty self explanatory. |
I can confirm the bug still exist with something as simple as class Company < ActiveRecord::Base
has_attached_file :logo, styles: { invoice: '1800x200>', thumb: '300x200>' }
end |
So I have found a potential work-around to this problem. It is not perfect but it gets the job done in the sense that it displays the image in different styles correctly. Paperclip also saves a copy of the original so it still keeps that in case you need it.
This will convert the styles to the format specified after the size when creating the styles. It will convert to and display the jpg or whatever file type you choose that ImageMagick can handle. Hope this is helpful to someone, I was stuck on this issue for 2 days. |
The problem seems to be in
ImageMagick’s
|
Looks like we found a workaround, closing. |
When I upload and SVG to a model that accepts image attachments that uses the thumbnail processor, it has issues resizing the svg. This seems to be an imagemagic bug. It will claim success but generate an invalid svg file. This isn't a big deal since it's an SVG and the same file can be used for all sizes, however it makes using the uploaded image difficult.
I figured out how to skip post process if the file is an svg but I would like to be able to still use the same styles throughout the site regardless of the file type. Is there a way to specify a processor that would copy the file for each style? Or perhaps overload the styles for a file type so they always point to the "full" style?
Thanks
(ccing @ArmandoAmador @reconbot)
The text was updated successfully, but these errors were encountered: