exiftool-rb / exiftool.rb Goto Github PK
View Code? Open in Web Editor NEWRuby exiftool wrapper that is simple, correct, and supports multiget
Ruby exiftool wrapper that is simple, correct, and supports multiget
There was an update to Minitest that broke great_expectations gem which we have dependency on.
Likely solution is to use pure minitest expectations by dropping archived great_expectations gem.
For the time being, adding require 'minitest/unit' to test_helper.rb as a temporary workaround during recent update.
I had to change line 21 to
exiftool_version.to_f > 0.0
because as steated on line 24
also I'm planning to add functionnality to write GPS datas...
Hi. I'm trying to remove some sensitive information (e.g.: GPS location) from uploaded files using exiftool.
When I try to check the existing EXIF data, it works:
Exiftool.new(file_path, '-ignoreMinorErrors').to_hash
# {
# "source_file": "image_with_gps.jpg",
# "exif_tool_version": 11.88,
# "file_name": "image_with_gps.jpg",
# "file_size": "6.0 MB",
# ...
# }
However, as soon as I try to change something in the file it starts complaining that exiftool is not installed
Exiftool.new(file_path, '-ignoreMinorErrors -gps:all= "-gps*=" -tagsfromfile @ -Orientation')
# Exiftool::ExiftoolNotInstalled raised
The problem seems to be with the lines checking that the result of the exiftool command is an empty string: lib/exiftool.rb#L58-L60.
I would help creating a PR to make my use-case viable if you're interested in it
Hi,
I'm seeking confirmation regarding the compatibility of the Exiftool 1.2.4 or 1.2.3 with the recently released Ruby 3.3.0 (December 25, 2023).
While I reviewed the gem's documentation on RubyGems and github(https://github.com/exiftool-rb/exiftool.rb/blob/master/.github/workflows/build.yml) it only specifies a minimum required Ruby version of > 2.4 and matrix: ruby-version: ['3.0', '3.1', '3.2'] respectively. Unfortunately, I haven't found any explicit confirmation on compatibility with newer versions like 3.3.0.
Given your expertise in this area, could you offer any insights or leads on this matter? Any information you can provide would be greatly appreciated.
Thank you for your time and assistance!
Travis CI seems very buggy with their usage credit system and limitations for open source projects. It takes forever to get free credits applied to an account and builds aren't running. We have switched to github actions for tests and that system has been working well for the repo. It's time to sunset the travis CI
I have some images with utf-8 encoded descriptions and captions. These seem to throw an exception in the gem as part of a Jekyll build. I can rescue from the exception and generate empty output utf-8 should work.
I'll attach a sample, but this is the offending line...
Description : Guarulhos airport, Saó Paulo, Brazil
Macbook Pro running Yosemite.
Jekyll 2.5.3 which is utf-8 by default.
The gem will choke if there's a field that has "Date" in it's key but is either not a Date or an invalid date.
Example :
"GPSDateTime": "0111:00:30 20:31:58Z" From Nexus S
When using a Pathname instead of a String for the file argument, I get an error.
See the following code:
require 'exiftool'
require 'pathname'
path=Pathname.new('p./public/images/test.jpg')
Exiftool.new(path)
will result in
NoMethodError: undefined method empty?' for #<Pathname:p./public/images/test.jpg>
the workaround is to convert the Pathname to a String:
Exiftool.new(path.to_s)
Ruby version 2.3.1
I'm running the following command with the extra argument -n
to extract the real exif data (I want the integer value for the orientation tag).
Exiftool.new('some-image-file.jpg,'-n').to_hash
I see some warnings for both the 'GPSLatitude' & 'GPSLongitude':
:gps_latitude=>"Warning: Parsing '52.7353472222222' for attribute 'GPSLatitude' raised undefined method
split' for 52.7353472222222:Float"`
I can try to pass an array of files as:
pics = Exiftool.new(Dir["/Users/niels/Pictures/Photos\ Library.photoslibrary/**/*.jpg"])
However, 'pics' will be nil.
An array of the files with full path can be created with just
e = Dir["/Users/niels/Pictures/Photos\ Library.photoslibrary/**/*.jpg"]
f = Exiftool.new(e)
will also cause f to be nil.
There are just over 20,000 files in the array "e".
I don't know what the issue is. Is it perl, the exiftool perl program? Is it ruby? The gem? Please let me know what I can do to help.
Here is the log:
2015-02-06T09:56:30.100Z 92320 TID-oxbi4ru1w WARN: invalid date 2015-02-06T09:56:30.101Z 92320 TID-oxbi4ru1w WARN: /Users/karthik/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/exiftool-0.6.0/lib/exiftool/field_parser.rb:33:in
civil'
/Users/karthik/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/exiftool-0.6.0/lib/exiftool/field_parser.rb:33:in civil_date'
And here's the code:
def filemeta(myfile)
return Exiftool.new(oldpath(myfile)).to_hash
end
I thought this was an EXIFtool error so I tried extracting the metadata using the exiftool system command, and it worked. I wonder where this issue is! Tried Googling for it, and nothing turned up.
it should be mentioned that one has to require 'pathname'
The gem doesn't recognize the exiftool
command even when it's installed.
That's because Windows' null device
doesn't follow the POSIX rules.
I added the gem 'os' to the file exiftool.rb.
require 'os'
I changed line #60 to
cmd = "#{self.class.command} #{exiftool_opts} -j -coordFormat \"%.8f\" #{escaped_filenames} 2> #{OS.dev_null}"
and that did it for me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.