1

I'm using ImageMagick and ruby gem 'rmagick'. Is it possible to get the image size of the image once I create an ImageMagick::Image object?

my_image = Magick::Image.read('picture.png')
=> picture.png=>picture.png PNG 3240x1554 3240x1554+0+0 DirectClass 8-bit 1167kb

my_image.class
 => Magick::Image

How can I get image dimensions 3240x1554 from the my_image object? Something like my_image.x_size.

ibaralf
  • 12,218
  • 5
  • 47
  • 69
  • 1
    As said above, see https://stackoverflow.com/questions/16266933/rmagick-how-do-i-find-out-the-pixel-dimension-of-an-image – fmw42 Feb 01 '19 at 01:00
  • 1
    @fmw42 - thumbs up. Didn't see that question. I'm closing this s duplicate. – ibaralf Feb 01 '19 at 17:28

0 Answers0