有没有一种简单的方法来获取Ruby中的图像尺寸? [英] Is there a simple way to get image dimensions in Ruby?

查看:109
本文介绍了有没有一种简单的方法来获取Ruby中的图像尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种简单的方法来获取Ruby中图像文件的宽度和高度尺寸,而无需使用ImageMagick或ImageScience(运行Snow Leapard)。

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).

推荐答案

libimage-size 是一个用于计算图像大小的Ruby库适用于各种图形格式。可以使用gem,也可以下载源tarball并解压缩 image_size.rb 文件。

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.

这篇关于有没有一种简单的方法来获取Ruby中的图像尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆