diff --git a/osxphotos/__init__.py b/osxphotos/__init__.py index 44c47242..f566b302 100644 --- a/osxphotos/__init__.py +++ b/osxphotos/__init__.py @@ -627,6 +627,20 @@ class PhotosDB: # should we return all edits or just most recent one? self._dbphotos[uuid]["edit_resource_id"] = row[2] + # get details on external edits + c.execute( "SELECT RKVersion.uuid, " + "RKVersion.adjustmentUuid, " + "RKAdjustmentData.originator, " + "RKAdjustmentData.format " + "FROM RKVersion, RKAdjustmentData " + "WHERE RKVersion.adjustmentUuid = RKAdjustmentData.uuid " + "AND RKVersion.isInTrash = 0") + + for row in c: + uuid = row[0] + if uuid in self._dbphotos: + self._dbphotos[uuid]["adjustmentFormatID"] = row[3] + # init any uuids that had no edits for uuid in self._dbphotos: if "edit_resource_id" not in self._dbphotos[uuid]: diff --git a/tests/Test-10.14.6.photoslibrary/database/photos.db-wal b/tests/Test-10.14.6.photoslibrary/database/photos.db-wal index e69de29b..3c18112d 100644 Binary files a/tests/Test-10.14.6.photoslibrary/database/photos.db-wal and b/tests/Test-10.14.6.photoslibrary/database/photos.db-wal differ diff --git a/tests/Test-10.14.6.photoslibrary/database/photos.db.lock b/tests/Test-10.14.6.photoslibrary/database/photos.db.lock new file mode 100644 index 00000000..83e2a368 --- /dev/null +++ b/tests/Test-10.14.6.photoslibrary/database/photos.db.lock @@ -0,0 +1,16 @@ + + + + + hostname + Rhets-MacBook-Pro.local + hostuuid + 9575E48B-8D5F-5654-ABAC-4431B1167324 + pid + 978 + processname + photolibraryd + uid + 501 + + diff --git a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotoAnalysisServicePreferences.plist b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotoAnalysisServicePreferences.plist index c7ba4e64..09a4b5e1 100644 --- a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotoAnalysisServicePreferences.plist +++ b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotoAnalysisServicePreferences.plist @@ -5,6 +5,6 @@ PhotoAnalysisGraphLastBackgroundGraphRebuildJobDate 2019-11-18T01:38:02Z PhotoAnalysisGraphLastBackgroundMemoryGenerationJobDate - 2019-11-27T05:30:14Z + 2019-12-01T15:41:06Z diff --git a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-shm b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-shm index fe9ac284..6b3bfff5 100644 Binary files a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-shm and b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-shm differ diff --git a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-wal b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-wal index e69de29b..282fad5e 100644 Binary files a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-wal and b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-wal differ diff --git a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter index 4fdc85b4..fce0698d 100644 --- a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter +++ b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter @@ -2,11 +2,7 @@ - ProcessedInQuiescentState - SuggestedMeIdentifier - Version - 3 diff --git a/tests/Test-10.14.6.photoslibrary/resources/media/version/00/00/fullsizeinput_c.jpeg b/tests/Test-10.14.6.photoslibrary/resources/media/version/00/00/fullsizeinput_c.jpeg new file mode 100644 index 00000000..30704a41 Binary files /dev/null and b/tests/Test-10.14.6.photoslibrary/resources/media/version/00/00/fullsizeinput_c.jpeg differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/media/version/00/00/fullsizeoutput_d.jpeg b/tests/Test-10.14.6.photoslibrary/resources/media/version/00/00/fullsizeoutput_d.jpeg new file mode 100644 index 00000000..088893a9 Binary files /dev/null and b/tests/Test-10.14.6.photoslibrary/resources/media/version/00/00/fullsizeoutput_d.jpeg differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist b/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist index 56b23dc4..41c4e08b 100644 --- a/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist +++ b/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist @@ -3,7 +3,7 @@ LastHistoryRowId - 522 + 558 LibraryBuildTag D8C4AAA1-3AB6-4A65-BEBD-99CC3E5D433E LibrarySchemaVersion diff --git a/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_mini_6.jpg b/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_mini_6.jpg deleted file mode 100644 index 0fddde1a..00000000 Binary files a/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_mini_6.jpg and /dev/null differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_thumb_6.jpg b/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_thumb_6.jpg deleted file mode 100644 index c64fcafd..00000000 Binary files a/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_thumb_6.jpg and /dev/null differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/yd1KuwTpRaSh3At8YfJ7OQ_mini_6.jpg b/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/yd1KuwTpRaSh3At8YfJ7OQ_mini_6.jpg new file mode 100644 index 00000000..226d337d Binary files /dev/null and b/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/yd1KuwTpRaSh3At8YfJ7OQ_mini_6.jpg differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/yd1KuwTpRaSh3At8YfJ7OQ_thumb_6.jpg b/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/yd1KuwTpRaSh3At8YfJ7OQ_thumb_6.jpg new file mode 100644 index 00000000..85c0fbd5 Binary files /dev/null and b/tests/Test-10.14.6.photoslibrary/resources/proxies/derivatives/00/00/6/yd1KuwTpRaSh3At8YfJ7OQ_thumb_6.jpg differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKAdjustmentData/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKAdjustmentData/0000000000.lij index 7ffc0291..69c40d1c 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKAdjustmentData/0000000000.lij and b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKAdjustmentData/0000000000.lij differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKImageProxyState/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKImageProxyState/0000000000.lij index e27c53cb..08305e5c 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKImageProxyState/0000000000.lij and b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKImageProxyState/0000000000.lij differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKModelResource/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKModelResource/0000000000.lij index 6f49cdf5..2b43df90 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKModelResource/0000000000.lij and b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKModelResource/0000000000.lij differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij index 23cc9007..fa462206 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij and b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij index 21c78f9d..3159d909 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij and b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij index 54e18d09..f9537e87 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij and b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/segments/Thumb64Segment_0.data b/tests/Test-10.14.6.photoslibrary/resources/segments/Thumb64Segment_0.data index c7694d14..d62e8211 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/segments/Thumb64Segment_0.data and b/tests/Test-10.14.6.photoslibrary/resources/segments/Thumb64Segment_0.data differ diff --git a/tests/Test-10.14.6.photoslibrary/resources/segments/ThumbJPGSegment_0.data b/tests/Test-10.14.6.photoslibrary/resources/segments/ThumbJPGSegment_0.data index acc56717..b661d2db 100644 Binary files a/tests/Test-10.14.6.photoslibrary/resources/segments/ThumbJPGSegment_0.data and b/tests/Test-10.14.6.photoslibrary/resources/segments/ThumbJPGSegment_0.data differ diff --git a/tests/test_mojave_10_14_6.py b/tests/test_mojave_10_14_6.py index ea8ad2e2..9e7c7d07 100644 --- a/tests/test_mojave_10_14_6.py +++ b/tests/test_mojave_10_14_6.py @@ -230,6 +230,30 @@ def test_hasadjustments2(): assert p.hasadjustments() == False +def test_external_edit1(): + # test image has been edited in external editor + import osxphotos + + photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) + photos = photosdb.photos(uuid=["3Jn73XpSQQCluzRBMWRsMA"]) + assert len(photos) == 1 + p = photos[0] + + assert p.external_edit() == True + + +def test_external_edit2(): + # test image has not been edited in external editor + import osxphotos + + photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) + photos = photosdb.photos(uuid=["6bxcNnzRQKGnK4uPrCJ9UQ"]) + assert len(photos) == 1 + p = photos[0] + + assert p.external_edit() == False + + def test_path_edited1(): # test a valid edited path import osxphotos