Forum: Ruby Paperclip plugin changing original image extension

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tony T. (Guest)
on 2008-11-10 05:32
Hi guys,

I got what I assume is a pretty simple question.

I need to convert the original image filename from a paperclip plugin
upload to be .png. So all files uploaded (.jpg or .gif) will be
converted to .png WITHOUT changing the original image size/proportions.

I've been able to do this with thumbnails with the following code under

:thumb=> ["50x50#", :png]

but if I try to do :original => :png it won't work. Again, I'm sure this
is super simple but I can't find the answer for the life of me.

Thanks in advance!

Tony T. (Guest)
on 2008-11-10 06:12
I decided to just add a maximum image file size for the original image.
I already have a maximum attachment size of 1mb but it's still nice to
keep things a bit under control.

So I just added the following to the styles:
:original => ["800x600>", :png]

and it works as intended (resizing if over 800x600 AND converts to png).
Still would be nice to know what the code is to change the extension of
the original file though for future reference. Again, I know it's
probably simple but my mind is running on E right now.

Thanks again and hope this helps someone in the future!

This topic is locked and can not be replied to.