[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RMagick: img.extract_info contains no data

Guido Holz

2/19/2008 9:53:00 AM

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
--
Posted via http://www.ruby-....

2 Answers

Alex Podaras

2/19/2008 10:11:00 AM

0

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

On Feb 19, 2008, at 11:52 AM, Guido Holz wrote:

> 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
> --
> Posted via http://www.ruby-....
>


Guido Holz

2/19/2008 10:14:00 AM

0

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 ;-)
--
Posted via http://www.ruby-....