Updated path_derivatives to return results in sorted order (largest to smallest)

This commit is contained in:
Rhet Turnbull
2021-05-09 17:52:24 -07:00
parent 98b84c17f1
commit f24e4a7e3c
19 changed files with 38 additions and 41 deletions

View File

@@ -2263,7 +2263,7 @@ Returns the absolute path to the edited photo on disk as a string. If the photo
**Note**: will also return None if the edited photo is missing on disk.
#### `path_derivatives`
Returns list of paths to any derivative preview images associated with the photo. These will be named something like this on Photos 5+:
Returns list of paths to any derivative preview images associated with the photo. The list of returned paths is sorted in descieding order by size (the largest, presumably highest quality) preview image will be the first element in the returned list. These will be named something like this on Photos 5+:
- `F19E06B8-A712-4B5C-907A-C007D37BDA16_1_101_o.jpeg`
- `F19E06B8-A712-4B5C-907A-C007D37BDA16_1_102_o.jpeg`
@@ -2275,9 +2275,9 @@ On Photos <=4, they'll be named something like:
- `UNADJUSTEDNONRAW_thumb_6.jpg`
- `Y6OofYkbR96spbS6XgwOQw_mini_1.jpg`
I've not yet decoded the suffixes to know which preview is used for which purpose but in general, if you look for the largest file, you'll get the highest resolution preview.
I've not yet decoded the suffixes to know which preview is used for which purpose but in general, if you look for the largest file, you'll get the highest resolution preview. Note that video files and Live images may have both a `.mov` video preview as well as a `.jpeg` still-image preview (the JPEG file is the one Photos displays as the "cover" for the video.)
Returns empty list if no preview images are found.
Returns empty list if no preview images are found.
#### `path_raw`
Returns the absolute path to the associated raw photo on disk as a string, if photo is part of a RAW+JPEG pair, otherwise returns None. See [notes on Raw Photos](#raw-photos).