1

I'm attempting to get image EXIF data from the ruby-vips gem but I keep receiving errors. I've found documentation from others who have attempted to repair this issue and I've attempted their fixes with no success.

i=VIPS::Image.new("/home/eric/Pictures/golden-clouds-wallpaper.jpg")
i.get("exif-Orientation")
i.get("exif-ifd0-Orientation")

Both give errors:

VIPS error: vips_image_get: field "exif-Orientation" not found
VIPS error: vips_image_get: field "exif-ifd0-Orientation" not found

Ubuntu version 13.10

Vips version 7.28.5

ruby-vips 0.3.7

Edit

2.1.0 :001 > require 'rubygems' => false 
2.1.0 :002 > require 'vips' => true 
2.1.0 :003 > a = VIPS::Image.new('/home/eric/Pictures/devProfile.JPG') => #<VIPS::Image:0x00000001e4d7b0> 
2.1.0 :004 > a.get("exif-Orientation")
VIPS::Error: VIPS error: vips_image_get: field "exif-Orientation" not found

from (irb):4:in `get'
from (irb):4
from /home/eric/.rvm/rubies/ruby-2.1.0/bin/irb:11:in `<main>'
4

1 回答 1

0

安装 vips GUI,nip2,然后尝试在其中加载您的 JPEG 图像。右键单击缩略图,选择标题,然后查看显示的字段。你应该在那里看到方向。

我在这里有 Ubuntu 13.10 / vips-7.28.5 / ruby​​-vips 0.3.7,我看到:

$ vips --version
vips-7.28.5-Sat Mar  9 18:46:42 UTC 2013
$ gem install ruby-vips
Fetching: ruby-vips-0.3.7.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ruby-vips-0.3.7
1 gem installed
Installing ri documentation for ruby-vips-0.3.7...
Installing RDoc documentation for ruby-vips-0.3.7...
$ irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'vips'
=> true
irb(main):003:0> a = VIPS::Image.new("pics/img_2522.jpg")
=> #<VIPS::Image:0x00000001a0e528>
irb(main):004:0> a.get("exif-Orientation")
=> "1 (Top-left, Short, 1 components, 2 bytes)"
irb(main):005:0> 
于 2014-02-12T08:56:53.093 回答