RhetTbull / osxphotos

Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.
MIT License
2.16k stars 100 forks source link

Missing database? To old iPhoto libraries? #1608

Open ArneAnka opened 4 months ago

ArneAnka commented 4 months ago

Before submitting a bug report, please ensure you are running the most recent version of osxphotos and that the bug is reproducible on the latest version

Describe the bug I have a number of iPhoto libraries that seems to be a just copy-and-paste from the original source. I dont know what iPhotos version or macos version they are from. When i try to export the images and videos with: $ osxphotos export --export-by-date --library ./iPhoto\ Library dump i receive this crash log:

osxphotos crash log
Created: 2024-07-06 12:54:06.411173
osxphotos version: 0.68.2
Platform: macOS-14.5-arm64-arm-64bit
Python version: 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)]
sys.argv: ['/Users/user1/.local/bin/osxphotos', 'export', '--export-by-date', '--update', '--library', './iPhoto Library 3', 'dump']
CRASH_DATA:
locals: {'dest': 'dump', 'db': './iPhoto Library 3', 'add_exported_to_album': None, 'add_missing_to_album': None, 'add_skipped_to_album': None, 'added_after': None, 'added_before': None, 'added_in_last': None, 'album': (), 'album_keyword': False, 'alt_db': None, 'alt_copy': False, 'append': False, 'fix_orientation': False, 'beta': False, 'burst': False, 'checkpoint': None, 'cleanup': False, 'cloudasset': False, 'config_only': False, 'convert_to_jpeg': False, 'crash_after': None, 'current_name': False, 'deleted': False, 'deleted_only': False, 'description': (), 'description_template': None, 'directory': None, 'download_missing': False, 'dry_run': False, 'duplicate': False, 'edited': False, 'edited_suffix': None, 'exif': (), 'exiftool': False, 'exiftool_merge_keywords': False, 'exiftool_merge_persons': False, 'exiftool_option': (), 'exiftool_path': None, 'export_as_hardlink': False, 'export_by_date': True, 'exportdb': None, 'external_edit': False, 'favorite': False, 'favorite_rating': False, 'filename_template': None, 'finder_tag_keywords': False, 'finder_tag_template': (), 'folder': (), 'force_update': False, 'from_date': None, 'from_time': None, 'has_comment': False, 'has_likes': False, 'has_raw': False, 'hdr': False, 'hidden': False, 'ignore_case': False, 'ignore_date_modified': False, 'ignore_exportdb': False, 'ignore_signature': False, 'in_album': False, 'incloud': False, 'is_reference': False, 'jpeg_ext': None, 'jpeg_quality': None, 'keep': (), 'keyword': (), 'keyword_template': (), 'label': (), 'limit': None, 'live': False, 'load_config': None, 'location': False, 'max_size': None, 'min_size': None, 'missing': False, 'name': (), 'no_comment': False, 'no_description': False, 'no_exportdb': False, 'no_keyword': False, 'no_likes': False, 'no_location': False, 'no_place': False, 'no_progress': False, 'no_title': False, 'not_burst': False, 'not_cloudasset': False, 'not_edited': False, 'not_favorite': False, 'not_hdr': False, 'not_hidden': False, 'not_in_album': False, 'not_incloud': False, 'not_live': False, 'not_missing': False, 'not_panorama': False, 'not_portrait': False, 'not_reference': False, 'not_screenshot': False, 'not_selfie': False, 'not_shared': False, 'not_slow_mo': False, 'not_time_lapse': False, 'only_movies': False, 'only_new': False, 'only_photos': False, 'original_suffix': None, 'overwrite': False, 'panorama': False, 'person': (), 'person_keyword': False, 'place': (), 'portrait': False, 'post_command': (), 'post_command_error': None, 'post_function': (), 'preview': False, 'preview_if_missing': False, 'preview_suffix': None, 'print_template': (), 'query_eval': (), 'query_function': (), 'ramdb': False, 'regex': (), 'replace_keywords': False, 'report': None, 'retry': None, 'save_config': None, 'screenshot': False, 'selfie': False, 'shared': False, 'export_aae': False, 'sidecar': (), 'sidecar_drop_ext': False, 'sidecar_template': (), 'skip_bursts': False, 'skip_edited': False, 'skip_live': False, 'skip_original_if_edited': False, 'skip_raw': False, 'skip_uuid': (), 'skip_uuid_from_file': None, 'slow_mo': False, 'strip': False, 'theme': None, 'time_lapse': False, 'timestamp': False, 'title': (), 'tmpdir': None, 'to_date': None, 'to_time': None, 'touch_file': False, 'update': True, 'update_errors': False, 'use_photokit': False, 'use_photos_export': False, 'uti': None, 'uuid': (), 'uuid_from_file': None, 'verbose_flag': 0, 'xattr_template': (), 'year': (), 'syndicated': False, 'not_syndicated': False, 'saved_to_library': False, 'not_saved_to_library': False, 'shared_moment': False, 'not_shared_moment': False, 'shared_library': False, 'not_shared_library': False, 'selected': False, 'ctx': <click.core.Context object at 0x105f7b530>, 'cli_obj': <osxphotos.cli.cli.CLI_Obj object at 0x102353560>}
osxphotos version: 0.68.2
Error: [Errno dbfile ./iPhoto Library 3/database/photos.db does not exist] ./iPhoto Library 3/database/photos.db
Traceback (most recent call last):
  File "/Users/user1/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/crash_reporter.py", line 79, in wrapped
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user1/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/cli/export.py", line 1115, in export
    return_code = export_cli(**locals())
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user1/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/cli/export.py", line 1866, in export_cli
    photosdb = osxphotos.PhotosDB(
               ^^^^^^^^^^^^^^^^^^^
  File "/Users/user1/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/photosdb/photosdb.py", line 342, in __init__
    raise FileNotFoundError(f"dbfile {dbfile} does not exist", dbfile)
FileNotFoundError: [Errno dbfile ./iPhoto Library 3/database/photos.db does not exist] ./iPhoto Library 3/database/photos.db

To Reproduce Steps to reproduce the behavior:

  1. What' the full command line you used with osxphotos? osxphotos export --export-by-date --library ./iPhoto\ Library dump
  2. What was the error output? see above

Expected behavior A clear and concise description of what you expected to happen.

I want all images and movies dumped in the folder dump. Im planning to run the same command on each of the five iPhoto libraries and concat them in the folder dump. This way, i should have extracted all unique images and movies.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

osxphotos, version 0.68.2 Python 3.12.4 (main, Jun 6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] macOS 14.5.0, arm64

Additional context Add any other context about the problem here.

RhetTbull commented 4 months ago

What's the output of:

ls ./iPhoto Library 3/database/

ArneAnka commented 4 months ago

Skärmavbild 2024-07-18 kl  16 49 10

I dont even have that folder.

RhetTbull commented 4 months ago

That appears to be a very old version of iPhoto which used a different database schema. Unfortunately OSXPhotos cannot read this database. The only version of iPhoto I've tested on is 9.6.1 (which I think was from OS X Yosemite). I only implemented that version so that I could export some photos I had in an old database. I would need access to a sample library from the version you have to add support to OSXPhotos. Do you know what version of macOS this was created on? Do you still have access to a Mac running that version?

ArneAnka commented 4 months ago

Thanks for your answers. I beleive that those libraries are from spanning from 2006-2014, so 10.6, 10.7, 10.8, 10.9 (Snow Leopard, Lion, Mountain Lion, Mavericks).

I dont have access to a mac running this versions, unfortunately

RhetTbull commented 4 months ago

Here are some alternatives that might work for you: