# Paperclip plugin changing original image extension

**URL:** <https://www.ruby-forum.com/t/paperclip-plugin-changing-original-image-extension/152934>\
**Category:** Ruby\
**Created:** [November 10, 2008, 4:32am UTC](https://www.ruby-forum.com/t/paperclip-plugin-changing-original-image-extension/152934 "2008-11-10T04:32:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bagadoughnuts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Post date:** [November 10, 2008, 4:32am UTC](https://www.ruby-forum.com/t/paperclip-plugin-changing-original-image-extension/152934/1 "2008-11-10T04:32:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bagadoughnuts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Post date:** [November 10, 2008, 5:12am UTC](https://www.ruby-forum.com/t/paperclip-plugin-changing-original-image-extension/152934/2 "2008-11-10T05:12:58Z")

</div>

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!

-Tony
