# Corrupt image Error with RMagick, was: Validating an Image f

**URL:** <https://www.ruby-forum.com/t/corrupt-image-error-with-rmagick-was-validating-an-image-f/110182>\
**Category:** Ruby\
**Created:** [July 24, 2007, 12:20am UTC](https://www.ruby-forum.com/t/corrupt-image-error-with-rmagick-was-validating-an-image-f/110182 "2007-07-24T00:20:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [July 24, 2007, 12:20am UTC](https://www.ruby-forum.com/t/corrupt-image-error-with-rmagick-was-validating-an-image-f/110182/1 "2007-07-24T00:20:42Z")

</div>

On Jul 18, 2007, at 7:28 PM, Tim H. wrote:

> in clear examples I’ll see what I can do to fix it. You can always  
> open a documentation bug in the RMagick bug tracker on RubyForge.
> 
> –  
> RMagick OS X Installer [[http://rubyforge.org/projects/rmagick/](http://rubyforge.org/projects/rmagick/)]  
> RMagick Hints & Tips [[http://rubyforge.org/forum/forum.php](http://rubyforge.org/forum/forum.php)?  
> forum\_id=1618]  
> RMagick Installation FAQ [[http://rmagick.rubyforge.org/install-](http://rmagick.rubyforge.org/install-)  
> faq.html]

Hey Mr. Hunter,  
I’m using RMagick semi-successfully now, in a dumb Rails app, works  
like a charm with jpg files, but png files give me a Corrupt image  
`path/to/image.png’ while using the same set of code as with jpg files:

```
 img = Image.read(image_to_alter)[0]

```

This is the line called out with the error.

Is it possible, since this was created with Photoshop CS2, that the  
png is somehow different from what RMagick expects to read? or is  
there something I’m missing with the fact that it contains a  
transparency?

Regards,  
John J.

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [July 24, 2007, 12:31am UTC](https://www.ruby-forum.com/t/corrupt-image-error-with-rmagick-was-validating-an-image-f/110182/2 "2007-07-24T00:31:22Z")

</div>

John J. wrote:

> > the performance of all the RMagick resizing methods.
> 
> Is it possible, since this was created with Photoshop CS2, that the  
> png is somehow different from what RMagick expects to read? or is  
> there something I’m missing with the fact that it contains a  
> transparency?
> 
> Regards,  
> John J.

Can you read the image with ImageMagick? Try

identify path/to/image.png
