Is there a simple way to get image dimensions in Ruby?

前端 未结 8 970
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 06:57

I\'m looking for an easy way to get width and height dimensions for image files in Ruby without having to use ImageMagick or ImageScience (running Snow Leapard).

8条回答
  •  孤街浪徒
    2020-12-14 07:04

    libimage-size is a Ruby library for calculating image sizes for a wide variety of graphical formats. A gem is available, or you can download the source tarball and extract the image_size.rb file.

提交回复
热议问题