-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading Exif Data Fails #44
Comments
Howdy, Also out of curiosity, how would I go about reading/understanding this the output of .exif? Please pardon my n00bness. Best, |
Oh, strange, it should work. I'll have a look. |
Thank you, much! I just noticed that fields which aren't prefixed with 'exif-' seem to work fine, with the notable exception of 'exif-data' which works fine... |
It could be a linking problem. Perhaps libvips is built against libexif but On Friday, 26 July 2013, Seve Salazar wrote:
|
It could also be a version mismatch. I think your ruby-vips and your command-line vips are using different versions of libvips, causing confusion. The latest libvips includes the ifd number in the exif field. This was necessary to correctly pass all exif data, since (crazily) you can have the same field in several ifds with different values and apparently that's fine. Try: irb(main):121:0* fred = VIPS::Image.new("/home/john/pics/img_0075.jpg")
=> #<VIPS::Image:0x000000017a3310>
irb(main):124:0> fred.get("exif-ifd0-Orientation")
=> "1 (Top-left, Short, 1 components, 2 bytes)"
irb(main):127:0> fred.set("exif-ifd0-Orientation", "4")
=> nil
irb(main):128:0> fred.write("a.jpg") then: $ header -a a.jpg
a.jpg: 1600x1200 uchar, 3 bands, srgb, jpegload
width: 1600
...
exif-ifd0-Model: Canon DIGITAL IXUS 300 (Canon DIGITAL IXUS 300, ASCII, 23 components, 23 bytes)
exif-ifd0-Orientation: 4 (Bottom-left, Short, 1 components, 2 bytes)
exif-ifd0-X-Resolution: 180/1 (180, Rational, 1 components, 8 bytes)
... |
That makes a lot of sense actually, to both comments. Ill give em a shot in the morning (I'm on the west coast of the US). We've just migrated our development environment to virtual machines, and I'm willing to bet this is a side effect as it works fine on the host system (OS X). If I get this settled tomorrow I'll close the ticket... Or at the very least update it, with what I've tried. Lastly if you don't mind, I'd like write a doc about it if its an environment issue! I sadly don't know C or C++ so I'd like to contribute what I can to the project (documentation). |
Look around the github wiki, there should be somewhere to add it. I'm on On Saturday, 27 July 2013, Seve Salazar wrote:
|
hi @tehprofessor I am running into the same issue. Can you post what you have tried and if it worked? |
Howdy! I should've followed through on on updating this, sorry! @jcupitt Was spot on. The issue for me was from a mismatched versions of vips, its dependencies, and ruby-vips. It came from upgrading, rather haphazardly (I now know), over time. Upon removing vips, it's dependencies, and reinstalling it all (and rubyvips) everything was fine. Rather painless, and I should've just done it to begin with. Also, @jcupitt I looked at the Wiki and how would you feel about a Troubleshooting, Common Problems, FAQ (?) page? E.g. Common ProblemsReading Exif data throws an errorExample Code img = VIPS::Image.new("img.jpg")
img.get('exif-Orientation')
VIPS::Error: VIPS error: vips_image_get: field "exif-Orientation" not found This is most commonly a result of a mismatched version of ruby vips and libvips. It is recommended to remove both, and reinstall. Generally speaking, this is a result of upgrading rubyvips without upgrading libvips and/or its dependencies. Originally discussed: #44 |
Good idea, I made this page: https://github.com/jcupitt/ruby-vips/wiki/Troubleshooting Feel free to add any more tips there. |
@jcupitt thanks for the response. I started learning about vips recently and just getting the hang of if when I ran into the problem. Can you help me with how to go about the re installation.I installed libvips using apt-get and ruby-vips using gem install.. Should i just do apt-get remove and gem uninstall and install again? Is that what you are recommending.? |
First check that your libvips has exif working correctly. Try:
and make sure the exif fields are showing up. Now uninstall and reinstall ruby-vips and try reading the fields using the names as they appear in the output of "header". |
I am on ubuntu. I used the jhead command to verify the header, |
There are several libvips packages. libvips-tools includes the "header" program, which displays image header fields using libvips. Try using that and verify that you see exif stuff. |
I coudn't find the header program in libvips-tools, /. Let me know if you want me a file a separate issue for this.. I have been struggling to get ruby-vips recognize exif headers for the last 2 days without any luck. I really don't want to use another library / gem for just manipulating exif headers as we have already been using ruby-vips for some other image processing jobs. |
Sorry, I hadn't realized that "header" wasn't packaged. I'll install 7.26 here and verify everything. |
I wiped everything and rebuilt with 7.26, it seems to work here: https://gist.github.com/jcupitt/6376738 I did have some problems when I had several libvipses installed, it seems "gem install" will try to use the system libvips ahead of one installed to a private prefix. Make sure you only have one libvips around and that ruby picks up the right one. |
Howdy,
When I attempt read EXIF data from an image, it fails with:
I've attached the image in question:
If I use
header -a tall-iphone-photo.jpg
it works and I get:I'm not sure if I'm doing something wrong? I've tried it using libvips versions
vips-7.32.2
andvips-7.34.1
on Debian Wheezy (7.1).Any help would be greatly appreciated. The goal is to orient the photo, then remove the exif-orientation data, so that it displays the same on all browsers-- maybe there's a built in way to do this already?
Best,
Seve
Update
The plot thickens, if I use vips version 7.30.2, on OS X, then I get:
I'm going to install 7.30.2 on my Debian machine and see if it fixes it.
The text was updated successfully, but these errors were encountered: