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

How to know which photo is causing a crash? #24

Open mlevin77 opened 1 year ago

mlevin77 commented 1 year ago

I've got DEBUG=3; it converts, and at some point I see

... ============W, [2023-09-24T06:49:29.326007 #80827] WARN -- : Bad date/time value "0000:00:00 00:00:00": mon out of range W, [2023-09-24T06:49:29.326055 #80827] WARN -- : Bad date/time value "0000:00:00 00:00:00": mon out of range W, [2023-09-24T06:49:29.326067 #80827] WARN -- : Bad date/time value "0000:00:00 00:00:00": mon out of range ================W, [2023-09-24T06:49:46.861895 #80827] WARN -- : malformed GPS degrees: expected [degrees, minutes, seconds]; got [NaN, NaN, NaN] W, [2023-09-24T06:49:46.861924 #80827] WARN -- : malformed GPS degrees: expected [degrees, minutes, seconds]; got [NaN, NaN, NaN] W, [2023-09-24T06:49:46.864357 #80827] WARN -- : malformed GPS degrees: expected [degrees, minutes, seconds]; got [NaN, NaN, NaN] W, [2023-09-24T06:49:46.864383 #80827] WARN -- : malformed GPS degrees: expected [degrees, minutes, seconds]; got [NaN, NaN, NaN] W, [2023-09-24T06:49:46.882677 #80827] WARN -- : malformed GPS degrees: expected [degrees, minutes, seconds]; got [NaN, NaN, NaN] W, [2023-09-24T06:49:46.882706 #80827] WARN -- : malformed GPS degrees: expected [degrees, minutes, seconds]; got [NaN, NaN, NaN] =====W, [2023-09-24T06:49:50.793211 #80827] WARN -- : Badly formed IFD: Infinity W, [2023-09-24T06:49:50.796622 #80827] WARN -- : Badly formed IFD: Infinity W, [2023-09-24T06:49:50.797049 #80827] WARN -- : Badly formed IFD: Infinity ===================================================================================================================/Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:102:in examine': no start of image marker found (EXIFR::MalformedJPEG) from /Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:34:inblock in initialize' from /Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:34:in open' from /Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:34:ininitialize' from iphoto2xmp.rb:579:in new' from iphoto2xmp.rb:579:inblock in

' from iphoto2xmp.rb:438:in each' from iphoto2xmp.rb:438:in
'

It's a bad photo somewhere, right?

mlevin77 commented 1 year ago

Ok I tried the new code you just put up (thanks!!), and it crashed again, here's the last few lines:

=====W, [2023-09-24T15:40:57.455925 #94129] WARN -- : Badly formed IFD: Infinity W, [2023-09-24T15:40:57.458701 #94129] WARN -- : Badly formed IFD: Infinity W, [2023-09-24T15:40:57.459120 #94129] WARN -- : Badly formed IFD: Infinity ===================================================================================================================iphoto2xmp.rb:591:in rescue in block in <main>': uninitialized constant EXIRF (NameError) Did you mean? EXIFR from iphoto2xmp.rb:579:inblock in

' from iphoto2xmp.rb:438:in each' from iphoto2xmp.rb:438:in
' /Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:102:in examine': no start of image marker found (EXIFR::MalformedJPEG) from /Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:34:inblock in initialize' from /Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:34:in open' from /Library/Ruby/Gems/2.6.0/gems/exifr-1.4.0/lib/exifr/jpeg.rb:34:ininitialize' from iphoto2xmp.rb:581:in new' from iphoto2xmp.rb:581:inblock in
' from iphoto2xmp.rb:438:in each' from iphoto2xmp.rb:438:in
'

is it possible to have it print which file it's about to work on, so I know which image is causing it?

RhetTbull commented 1 year ago

@mlevin77 progress is going well -- I can now do a simple export of an iPhoto database:

osxphotos export ~/Desktop/export --library iPhoto\ Library.photolibrary --directory "{folder_album}"
Exporting 15 photos to /Users/user/Desktop/export...
Exporting 15 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Processed: 15 photos, exported: 22, missing: 0, error: 0
Elapsed time: 0:00:00

Still some more work to do to enable sidecars and exiftool options but it's coming along nicely. Once complete osxphotos will be able to export in the exact same format as iphoto2xmp (by event with XMP files) or using any of the osxphotos options.

mlevin77 commented 1 year ago

That’s excellent! This weekend I’ll make and send you the iPhoto library you asked for.

Is there any chance that it can export star ratings and smart albums, so that Digicam can pick those up?

------ Original Message ------ From "Rhet Turnbull" @.> To "jensb/iphoto2xmp" @.> Cc "Levin, Michael" @.>; "Mention" @.> Date 9/29/23, 5:34:31 PM Subject [External] Re: [jensb/iphoto2xmp] How to know which photo is causing a crash? (Issue #24)

@mlevin77 https://github.com/mlevin77 progress is going well -- I can now do a simple export of an iPhoto database:

osxphotos export ~/Desktop/export --library iPhoto\ Library.photolibrary --directory "{folder_album}" Exporting 15 photos to /Users/user/Desktop/export... Exporting 15 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 Processed: 15 photos, exported: 22, missing: 0, error: 0 Elapsed time: 0:00:00 Still some more work to do to enable sidecars and exiftool options but it's coming along nicely. Once complete osxphotos will be able to export in the exact same format as iphoto2xmp (by event with XMP files) or using any of the osxphotos options.

— Reply to this email directly, view it on GitHub https://github.com/jensb/iphoto2xmp/issues/24#issuecomment-1741513455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIS7OAQWC63UAZKT3XWBUPDX445GPANCNFSM6AAAAAA5FA6WYU. You are receiving this because you were mentioned.Message ID: @.***>

Caution: This message originated from outside of the Tufts University organization. Please exercise caution when clicking links or opening attachments. When in doubt, email the TTS Service Desk at @.*** or call them directly at 617-627-3376.

RhetTbull commented 1 year ago

Is there any chance that it can export star ratings and smart albums, so that Digicam can pick those up?

Star ratings will be exportable (though I've yet to add the template for those). Smart Albums cannot be exported. They're stored in a proprietary format. I don't use Digikam so I don't know how its smart albums work even if I could figure out iPhoto/Photos. (Does DigiKam even support smart albums?) Regular albums can be exported both as metadata and as folders.

jensb commented 1 year ago

Smart Albums could be exported as "Saved Searches" for Digikam, but there is no official way to import these into Digikam so you'd have to manually put them into the right SQLite table (Digikam also uses SQlite) in the correct format. Also, there is no standard for this, like XMP for image metadata. iphoto2xmp avoids this issue by creating a top level "00_AlbumQueryData" folder which contains the actual (JSON format) raw query data of any "smart" objects in iPhoto, freeing them from the proprietary binary-only Property List Apple format at least. If anybody decodes what the keys and objects in these files mean, we could convert these to any format that your favorite software uses. However, for my case, it was far quicker to just duplicate the dozen smart albums I had into Digikam as named searches, so I didn't continue this in the code.

mlevin77 commented 1 year ago

got it, thanks. Btw I had reported a crash issue on the Github issues page.

-----Original Message----- From: jensb @. @.>> Reply-To: jensb/iphoto2xmp @. @.>> Date: Saturday, September 30, 2023 at 6:08 AM To: jensb/iphoto2xmp @. @.>> Cc: Michael Levin @. @.>>, Mention @. @.>> Subject: [External] Re: [jensb/iphoto2xmp] How to know which photo is causing a crash? (Issue #24)

Smart Albums could be exported as "Saved Searches" for Digikam, but there is no official way to import these into Digikam so you'd have to manually put them into the right SQLite table (Digikam also uses SQlite) in the correct format. Also, there is no standard for this, like XMP for image metadata. iphoto2xmp avoids this issue by creating a top level "00_AlbumQueryData" folder which contains the actual (JSON format) raw query data of any "smart" objects in iPhoto, freeing them from the proprietary binary-only Property List Apple format at least. If anybody decodes what the keys and objects in these files mean, we could convert these to any format that your favorite software uses. However, for my case, it was far quicker to just duplicate the dozen smart albums I had into Digikam as named searches, so I didn't continue this in the code. — Reply to this email directly, view it on GitHub https://github.com/jensb/iphoto2xmp/issues/24#issuecomment-1741731688 https://github.com/jensb/iphoto2xmp/issues/24#issuecomment-1741731688&gt;, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIS7OAQCF2B3F6YIX3GIGEDX47VQPANCNFSM6AAAAAA5FA6WYU https://github.com/notifications/unsubscribe-auth/AIS7OAQCF2B3F6YIX3GIGEDX47VQPANCNFSM6AAAAAA5FA6WYU&gt;. You are receiving this because you were mentioned.Message ID: @. @.>>

Caution: This message originated from outside of the Tufts University organization. Please exercise caution when clicking links or opening attachments. When in doubt, email the TTS Service Desk at @. @.> @. @.>> or call them directly at 617-627-3376.