janfri/mini_exiftool

ArgumentError: invalid byte sequence in UTF-8

schneikai opened this issue · 6 comments

hi,

i'm getting 'ArgumentError: invalid byte sequence in UTF-8' in gems/mini_exiftool-1.4.3/lib/mini_exiftool.rb:322 on this image https://dl.dropbox.com/u/3488707/metadata5small.jpg

the image has some german special chars like ä ö ß but other images with such characters work.

any ideas? would like to help.

kai

Glad it's not just me then. We're getting this on quite a few - v large batches so can't give a specific example at this point. I'm on a similar version to yours but upgrading to latest stable (1.5.1) so will let you know if that helps.

Which Ruby version are you using? Which operating system which console locale?

it's ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]. console locale is :en

It seems you use different encodings in different tags. You can see this when using exiftool direct:

exiftool -imagedescription -caption-abstract  metadata5small.jpg

However, you can fix it in MiniExiftool with the convert_encoding option

photo = MiniExiftool.new('metadata5small.jpg', :convert_encoding => true)

This is uses the -L option in exiftool and you get all values in Latin1 encoding.

Übrigens: Ich wohne in Niedersachsen. ;-)

is working nicely! thank you for your help!

viele grüße aus berlin! :)

Have run that across many thousands and not one error since :) thanks