RMagick: img.extract_info contains no data

G

Guido Holz

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
 
A

Alex Podaras

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
 
G

Guido Holz

Alex said:
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 ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top