Access Apple_iPhoto Library

by 陳亮 in Living > Life Hacks

45 Views, 0 Favorites, 0 Comments

Access Apple_iPhoto Library

螢幕截圖 2024-11-17 下午2.49.48副本.png

This instructables show how to make a simple search from the Apple discontinued iPhoto library.

Why Access Old Library?

Since 2014, Apple Photos app replaced their iPhoto app. While OS upgrade the photos in iPhoto will migrate to Photos app seamlessly. But the entire old iPhoto library still keep within the user's Pictures folder.

Sometimes you may want to access the old library contents but iPhoto app no longer exist anymore. This instructables show you a simple way to search those old library contents.

What Is PhoShare?

PhoShare is an app that written in Python v2.x that can access and export iPhoto Library.

phoshare allows you to export and synchronize your iPhoto library to a folder tree. It preserves both the original and modified image, your event and album organization, and applies your iPhoto titles, descriptions, keywords, and face tags to the IPTC/EXIF metadata of your images.

Since Apple discontinued iPhoto, this library also discontinued. But the Python code for access iPhoto library still workable if you still have Python v2.x.

Ref.:

https://code.google.com/archive/p/phoshare/downloads

https://github.com/lhagan/phoshare


Simple Design

螢幕截圖 2024-11-17 下午2.49.31.png

This project use a simple HTML form input the search parameters, then search iPhoto library and output the result.

Quick Start

If you are using docker, you can simple run follow command to kick start the server:

docker run -it -p 8000:8000 \
-v ~/Pictures/iPhotoLibrary/:/app/iPhotoLibrary \
moononournation/python:2.7-iphotoserver

Then browse to http://localhost:8000/ to see the iPhoto server web page.

Search by Album Name

螢幕截圖 2024-11-17 下午2.49.48.png
螢幕截圖 2024-11-17 下午2.52.07.png

Search by Person

螢幕截圖 2024-11-17 下午2.50.17.png
螢幕截圖 2024-11-17 下午2.51.35.png

Search Face by Person

螢幕截圖 2024-11-17 下午2.50.30.png
螢幕截圖 2024-11-17 下午2.50.59.png

Source Code

The sample source code can be found at GitHub:

https://github.com/moononournation/iPhoto-python-web.git

The iphotoserver.py implement iphotoHandler from SimpleHTTPServer.SimpleHTTPRequestHandler:

class iphotoHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):

Read the iPhoto library at the beginning:

album_xml_file = iphotodata.get_album_xmlfile('/app/iPhotoLibrary')

Override the POST request:

def do_POST(self):

Search with iphotodata class then return the search result as HTML format.

Modify & Run

If you still using Python 2.x, you can fill your iPhoto library path in iphotoserver.py:

album_xml_file = iphotodata.get_album_xmlfile('/app/iPhotoLibrary')

Then kick start the web server:

python iphotoserver.py

My sample code is just the beginning. Once you can run the server successfully, you can enhance the iphotoserver.py and add more feature on it.

Enjoy!

Now you can recall all your memories and reshare it again!