Paperclip plugin changing original image extension

T

Tony Tony

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
styles:

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

but if I try to do :eek:riginal => :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

Tony Tony

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:
:eek:riginal => ["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!

-Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top