Skip to content
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

to_hash method does not work #47

Closed
jedrekdomanski opened this issue Sep 4, 2016 · 1 comment
Closed

to_hash method does not work #47

jedrekdomanski opened this issue Sep 4, 2016 · 1 comment

Comments

@jedrekdomanski
Copy link

require 'exifr'
include EXIFR

unless ARGV[0] and File.exists?(ARGV[0])
puts "You need to give a name: imageInfo.rb \n\n"
exit
end
info = JPEG.new(ARGV[0])
File.open("info_#{File.basename(ARGV[0])}.txt", "w") do |output|
output.puts info.exif.to_hash.map{ |k,v| "#{k}: #{v}" }
end

undefined method `to_hash' for nil:NilClass (NoMethodError)

What's wrong?

@remvee
Copy link
Owner

remvee commented Sep 5, 2016

The #exif methods returns nil when the JPEG does not contain EXIF data.

@remvee remvee closed this as completed Sep 5, 2016
ombr pushed a commit to ombr/exifr that referenced this issue Jun 7, 2021
ombr pushed a commit to ombr/exifr that referenced this issue Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants