Coder Social home page Coder Social logo

exiftool.rb's Issues

Tests are broken when minitest 5.19 is used

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.

seems to be an error on line 21 of exiftool.rb

I had to change line 21 to
exiftool_version.to_f > 0.0

because as steated on line 24

This is a string, not a float, to handle versions like "9.40" properly.

also I'm planning to add functionnality to write GPS datas...

ExiftoolNotInstalled error when trying to remove EXIF data

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.

  1. Is this gem meant to be used for manipulating EXIF data? If no, is there one that you can recommend?
  2. Is there any additional exiftool option I need to add to keep my command compatible with this gem?

I would help creating a PR to make my use-case viable if you're interested in it

Compatibility Inquiry: Exiftool 1.2.4 or 1.2.3 with Ruby 3.3.0

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!

remove Travis CI builds

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

EXIF fields with non-Roman characters

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.

imgp6692

Some files can break the module.

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

using a Pathname as file argument results in error.

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

using the '-n' option for an image with gps coordinates gives warnings

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 methodsplit' for 52.7353472222222:Float"`

added an image for any testing:
2016-08-30 11 06 47

Mutliget returns nil

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.

Getting an invalid date error when extracting metadata for certain files

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.

Gem doesn't work on Windows

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.