jensb / iphoto2xmp

Export an Apple iPhoto image library to a new directory (using hardlinks) with all metadata saved in XMP sidecar files.
GNU General Public License v3.0
34 stars 9 forks source link

`block in calc_faces': undefined method `*' for nil:NilClass (NoMethodError) #10

Closed whoismattclark closed 7 years ago

whoismattclark commented 7 years ago

I assume it's an issue with that image file but I don't know where to start debugging.

 3270(2642): IMG_4478.JPG   IMG_4478.JPG    0* 83423A…/eH%L8o…  taken:20081215-011215-0600 edit:20121124-042419-0600 import:20081215-205653-0600    
  Orig: 1704x2272 (1.0000/1.0000), Masters/2008/pre Xmas 08/IMG_4478.JPG (found)
     => 0/IMG_4478_v2.JPG
  Mod : 1704x2272, Previews/2008/pre Xmas 08/IMG_4478.JPG (found)
     => 0/IMG_4478_v3.JPG
  Flip: EXIF 90°/0°, photo 0°, face(s): 0°
  GPS : lat: lng:, 
  AlbumTags: ["TopLevelAlbums/temp/Chrsitmas 2009 Ornament"]
  Edit:  
  ... Original Face DB data:
  ...     face: tl: 0.209507 0.745305, wh: 0.449824 0.218310,  Garet  (1115)
  ...  modface: tl: 0.209507 0.336268, wh: 0.449824 0.599765,  Garet  (1115)
  ... After processing:
iphoto2xmp.rb:213:in `block in calc_faces': undefined method `*' for nil:NilClass (NoMethodError)
    from iphoto2xmp.rb:197:in `collect'
    from iphoto2xmp.rb:197:in `calc_faces'
    from iphoto2xmp.rb:757:in `block in <main>'
    from iphoto2xmp.rb:414:in `each'
    from iphoto2xmp.rb:414:in `<main>'
whoismattclark commented 7 years ago

Happened again. Looks like an issue with rotated photos.

 3791(2779): IMG_4907.JPG   IMG_4907    5* 663DDA…/rUtrPH…  taken:20090304-015529-0600 edit:20121124-042433-0600 import:20090317-225836-0500    
  Orig: 1704x2272 (1.0000/1.0000), Masters/2009/Mar 17, 2009/IMG_4907.JPG (found)
  Mod : 1704x2272, Previews/2009/Mar 17, 2009/IMG_4907.JPG (found)
     => 0/IMG_4907_v1.JPG
  Flip: EXIF 90°/0°, photo 0°, face(s): 0°
  GPS : lat: lng:, 
iphoto2xmp.rb:213:in `block in calc_faces': undefined method `*' for nil:NilClass (NoMethodError)
    from iphoto2xmp.rb:197:in `collect'
    from iphoto2xmp.rb:197:in `calc_faces'
    from iphoto2xmp.rb:757:in `block in <main>'
    from iphoto2xmp.rb:414:in `each'
    from iphoto2xmp.rb:414:in `<main>'
jensb commented 7 years ago

It seems there is a problem with the image rotation factor, it is neither 0 nor 90, 180 or 270 degrees. I don't quite believe that to be the case though ... I have uploaded another patch that can serve as a fallback, In this case the faces might be positioned incorrectly but the app shouldn't stop at the image. Can you try the updated version?

whoismattclark commented 7 years ago

Thanks for the patch!