# RMagick: img.extract\_info contains no data

**URL:** <https://www.ruby-forum.com/t/rmagick-img-extract-info-contains-no-data/129531>\
**Category:** Ruby\
**Created:** [February 19, 2008, 10:53am UTC](https://www.ruby-forum.com/t/rmagick-img-extract-info-contains-no-data/129531 "2008-02-19T10:53:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![der\_guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@der\_guido](https://www.ruby-forum.com/u/der_guido)\
**Post date:** [February 19, 2008, 10:53am UTC](https://www.ruby-forum.com/t/rmagick-img-extract-info-contains-no-data/129531/1 "2008-02-19T10:53:06Z")

</div>

Hi guys…

i tried to find out the height and width of an img:

img = Image.read(absolut\_path\_to\_a\_nice\_picture).first  
puts img.inspect  
puts img.extract\_info

gets:

nice\_picture.jpg JPEG 3504x2336 3504x2336+0+0 DirectClass 8-bit 2727kb  
width=0, height=0, x=0, y=0

anybody knows, how I can get the sizes of an image?!?

thanks Guido

---

<div class="post-metadata">

**Author:** ![der\_guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@der\_guido](https://www.ruby-forum.com/u/der_guido)\
**Post date:** [February 19, 2008, 11:12am UTC](https://www.ruby-forum.com/t/rmagick-img-extract-info-contains-no-data/129531/2 "2008-02-19T11:12:49Z")

</div>

Hello Guido,

Try this:

img = Image.read(absolute\_path\_to\_a\_nice\_picture).first

puts 'Width: ', img.columns  
puts 'Height: ', img.rows

Hope this helps

Regards,  
Alex

---

<div class="post-metadata">

**Author:** ![der\_guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@der\_guido](https://www.ruby-forum.com/u/der_guido)\
**Post date:** [February 19, 2008, 11:14am UTC](https://www.ruby-forum.com/t/rmagick-img-extract-info-contains-no-data/129531/3 "2008-02-19T11:14:03Z")

</div>

Alex Podaras wrote:

> Hello Guido,
> 
> Try this:
> 
> img = Image.read(absolute\_path\_to\_a\_nice\_picture).first
> 
> puts 'Width: ', img.columns  
> puts 'Height: ', img.rows
> 
> Hope this helps
> 
> Regards,  
> Alex

thats rocks! thanx 😉
