# Image manipulation on the fly

**URL:** <https://www.ruby-forum.com/t/image-manipulation-on-the-fly/146118>\
**Category:** Rails\
**Created:** [August 18, 2008, 7:55am UTC](https://www.ruby-forum.com/t/image-manipulation-on-the-fly/146118 "2008-08-18T07:55:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrSBless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@MrSBless](https://www.ruby-forum.com/u/MrSBless)\
**Post date:** [August 18, 2008, 7:55am UTC](https://www.ruby-forum.com/t/image-manipulation-on-the-fly/146118/1 "2008-08-18T07:55:10Z")

</div>

Let say i have rails.png file in my public/image directory and its  
size is 100X100. Now my question is how can i display this image with  
size say 200X200 in my view file. And i don’t want to store any other  
image rails.png of size 100X100.

---

<div class="post-metadata">

**Author:** ![MrSBless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@MrSBless](https://www.ruby-forum.com/u/MrSBless)\
**Post date:** [August 21, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/image-manipulation-on-the-fly/146118/2 "2008-08-21T14:06:50Z")

</div>

Dear all,  
I used to display image of different size from a single image  
source using gd image manipulation in PHP . eg:  
 ![]()

to show image of max height 100 and max width 100 from image of any  
size “image1.jpg”

I am having problem to do the same thing on ruby on rails.

Will you not mind giving me the example using RMagick or any other.

---

<div class="post-metadata">

**Author:** ![MrSBless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@MrSBless](https://www.ruby-forum.com/u/MrSBless)\
**Post date:** [August 19, 2008, 7:12am UTC](https://www.ruby-forum.com/t/image-manipulation-on-the-fly/146118/3 "2008-08-19T07:12:43Z")

</div>

Mr. Bless wrote:

> Let say i have rails.png file in my public/image directory and its  
> size is 100X100. Now my question is how can i display this image with  
> size say 200X200 in my view file. And i don’t want to store any other  
> image rails.png of size 100X100.

You can expand by setting the size in the html to larger, or I suppose  
use rmagick or mini\_magick.  
-=R
