# Good image API for RoR?

**URL:** <https://www.ruby-forum.com/t/good-image-api-for-ror/57885>\
**Category:** Rails\
**Created:** [April 15, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885 "2006-04-15T15:46:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcernelli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/73ab20/32.png) [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Post date:** [April 15, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885/1 "2006-04-15T15:46:44Z")

</div>

Hi, I need a relatively simple image api for the app I’m writing. I  
need to copy photos, rename them, and re-size them to put them in a  
standard format.

I tried using RMagick/Imagemagick, but the photos would be corrupted on  
re-size, so I’m looking for some suggestions.

---

<div class="post-metadata">

**Author:** ![jcernelli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/73ab20/32.png) [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Post date:** [April 15, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885/2 "2006-04-15T16:27:15Z")

</div>

On Sat, 2006-04-15 at 15:46 +0200, Joe C. wrote:

> Hi, I need a relatively simple image api for the app I’m writing. I  
> need to copy photos, rename them, and re-size them to put them in a  
> standard format.
> 
> I tried using RMagick/Imagemagick, but the photos would be corrupted on  
> re-size, so I’m looking for some suggestions.

* * *

try again but only give one dimension and the other should adjust  
proportionately.

Craig

---

<div class="post-metadata">

**Author:** ![jcernelli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/73ab20/32.png) [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Post date:** [April 15, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885/3 "2006-04-15T19:25:54Z")

</div>

On Apr 15, 2006, at 6:46 AM, Joe C. wrote:

> Hi, I need a relatively simple image api for the app I’m writing. I  
> need to copy photos, rename them, and re-size them to put them in a  
> standard format.
> 
> I tried using RMagick/Imagemagick, but the photos would be  
> corrupted on  
> re-size, so I’m looking for some suggestions.

On a project I’m working on we just fixed a problem with RMagick,  
resizing, and image corruption.

Solution: Get current versions of everything and recompile.

We didn’t have time to completely narrow it down, but in our case it  
was likely libtiff causing the problem.

---

<div class="post-metadata">

**Author:** ![jcernelli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/73ab20/32.png) [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Post date:** [April 15, 2006, 9:48pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885/4 "2006-04-15T21:48:37Z")

</div>

Joe C. wrote:

> Hi, I need a relatively simple image api for the app I’m writing. I  
> need to copy photos, rename them, and re-size them to put them in a  
> standard format.
> 
> I tried using RMagick/Imagemagick, but the photos would be corrupted on  
> re-size, so I’m looking for some suggestions.

I found myself in a simular situation recently re. RMagik [I def intend to go back and resolve it tho] - in our case tho we were preprocessing  
the files [i.e. batchs of thousands of files], zipping them up and  
sending to ROR. Since the preprocessing was external I used the python  
PIL library:

[http://www.pythonware.com/products/pil/](http://www.pythonware.com/products/pil/)

Anyhow an option…

---

<div class="post-metadata">

**Author:** ![jcernelli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/73ab20/32.png) [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Post date:** [April 15, 2006, 9:50pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885/5 "2006-04-15T21:50:48Z")

</div>

I used the python

> PIL library:
> 
> [http://www.pythonware.com/products/pil/](http://www.pythonware.com/products/pil/)
> 
> Anyhow an option…

If you go with it and are doing resizing, make sure to read up on the  
‘Image.ANTIALIAS’ - otherwise things are distorted…

---

<div class="post-metadata">

**Author:** ![jcernelli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/73ab20/32.png) [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Post date:** [April 15, 2006, 11:10pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885/6 "2006-04-15T23:10:31Z")

</div>

I’m working on something similar and I’m using MiniMagick. That library  
is  
also dependent on ImageMagick, but it uses the command-line mogrify tool  
rather than a direct Ruby interface to 'Magick, which uses way, way less  
memory.

Of course, if the problem you’re experiencing is with ImageMagick and  
not  
RMagick, then this will be six of one/half dozen of another. I might  
suggest  
trying MiniMagick (which is a quick and easy thing to drop into one’s  
plugins folder) just to isolate the problem.

- DD

On 4/15/06, Joe C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–

David D.  
Owner and Web Chef, Practicalmadness  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![jcernelli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/73ab20/32.png) [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Post date:** [April 15, 2006, 11:52pm UTC](https://www.ruby-forum.com/t/good-image-api-for-ror/57885/7 "2006-04-15T23:52:32Z")

</div>

Thanks a ton everyone… there is enough here to get me on the right  
road! One of the things I’m loving about getting into Ruby is the  
outstanding community around it.

Once again thanks!
