开发者

Only convert images of a certain file type with paperclip styles

开发者 https://www.devze.com 2023-02-14 05:38 出处:网络
I want to convert uploaded images that are not jpegs or pngs to to be jpegs or pngs using paperclip.Problem is i dont want to convert jpegs to pngs or pngs to jpegs, just leave them as the file type t

I want to convert uploaded images that are not jpegs or pngs to to be jpegs or pngs using paperclip. Problem is i dont want to convert jpegs to pngs or pngs to jpegs, just leave them as the file type they are.

Is this possible ? If so how do i create the styles all in jpeg or png ?

Also what is the best file type to save as? I cant convert some pngs to jpg开发者_Python百科s as if they had transparency in that gets lost / changed. Also if i change all to png is not bigger and alos i am using Prawn pdf outputting these images so cant use gif.

Any pointers anyone ?

Thanks alot Rick


In order to do this you will need to create a custom Paperclip::Processor. You can probably subclass the Paperclip::Thumbnail in doing so.

0

精彩评论

暂无评论...
验证码 换一张
取 消