Skip to content

Commit 296e748

Browse files
committed
First part of fixing #15
Photos downloaded to the device from iCloud are now extracted correctly, but under internal names like `C03E764D-495E-403B-A24C-5C9B5B607218.jpg`.
1 parent dedf5a0 commit 296e748

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/ios_backup_extractor.pl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ sub extractMediaFiles
447447
&& $relative_path !~ /metadata/i
448448
&& $relative_path =~ /\.$wanted_extensions$/i);
449449
450-
# determine filename
450+
# determine filename, e.g.
451+
# [DCIM]
452+
# * Media/DCIM/101APPLE/IMG_1111.JPG
453+
# * Media/PhotoData/Mutations/DCIM/101APPLE/IMG_1111/Adjustments/FullSizeRender.jpg
451454
unless ($relative_path =~ m{^
452455
(?<media_location>
453456
.+
@@ -461,6 +464,24 @@ sub extractMediaFiles
461464
(?<extension>
462465
(?i:$wanted_extensions))
463466
$
467+
}x
468+
# [iCloud]
469+
# * Media/PhotoData/CPLAssets/group101/1A1A1A1A-1A1A-1A1A-1A1A-1A1A1A1A1A1A.HEIC
470+
# * Media/PhotoData/Mutations/PhotoData/CPLAssets/group101 \
471+
# /1A1A1A1A-1A1A-1A1A-1A1A-1A1A1A1A1A1A/Adjustments/FullSizeRender.jpg
472+
or $relative_path =~ m{^
473+
(?<media_location>
474+
.+
475+
/PhotoData/CPLAssets/)
476+
(?<media_subdir>
477+
group\d+/)
478+
(?<filename>
479+
[^./]+)
480+
(?:\.|/)
481+
.*
482+
(?<extension>
483+
(?i:$wanted_extensions))
484+
$
464485
}x)
465486
{
466487
warn qq{Warning: Cannot determine filename from "$relative_path"\n}

0 commit comments

Comments
 (0)