Data relationship between original picture and preview thumbnails

Open SQLite database /database/photos.db

My path-to-your-photos-library-"file" is 
/Volume/Mac Photos/MacPhotos.libraries/Photos.photoslibrary

hence my path of database is
/Volume/Mac Photos/MacPhotos.libraries/Photos.photoslibrary/database/photos.db
  1. Get modelId from RKMaster
select modelId from RKMaster where imagePath='2017/10/14/20171014-120320/1507889041932.mp4'

imagePath here means the path under folder /Masters/
where your pictures/videos were imported by Photos app. The date of the folder is the importing date and time, but not the date time when the picture was taken.

we got 34591 for this record.

  1. Get modelId from RKVersion via column masterId
select modelId from RKVersion where masterId = 34591

We can also link up these 2 tables via columns RKMaster.uuid and RKVersion.masterUuid

we got 36841 for this record.

  1. Transform decimal (36841) to hexadecimal (8fe9)

  2. Get preview thumbnails from Finder
    /Volume/Mac Photos/MacPhotos.libraries/Photos.photoslibrary/resources/proxies/derivatives/8f/00/8fe9
    i.e.
    /resources/proxies/derivatives//00/

you can see files as follows:
UNADJUSTEDNONRAW_largepv_8fe9.jpg
UNADJUSTEDNONRAW_mini_8fe9.jpg
UNADJUSTEDNONRAW_thumb_8fe9.jpg

For pictures, there're only 2 files, i.e. mini and thumb.
For videos, there're 3 files, i.e. largepv, mini and thumb.

你可能感兴趣的:(Data relationship between original picture and preview thumbnails)