Skip to content

Photos refuses a file Apple won't take before sending any of it - #269

Merged
YashwanthKamireddi merged 1 commit into
mainfrom
fix/upload-precheck
Nov 25, 2026
Merged

YashwanthKamireddi merged 1 commit into
mainfrom
fix/upload-precheck

Conversation

@YashwanthKamireddi

Copy link
Copy Markdown
Owner

Apple only says no to a file once all of it is up, so an AVI, a panorama
past Photos' size or a video in an old camera codec went up whole (up to
500 MB) to be refused. Now a few header reads decide first:

  • a photo past 20,480 px a side or 419,430,400 px in all (JPEG, PNG, GIF,
    WebP, TIFF, HEIC through its primary item's ispe), as icloud.com checks;
  • AVI, MKV/WebM, MPEG-PS/TS, ASF/WMV, FLV and WeChat WXGF content,
    whatever the file is named; .avi dropped from the types;
  • MP4/MOV tracks in MPEG-4 Part 2, Motion JPEG, or camera PCM sound
    (twos/sowt/raw), read from the sample descriptions with a bounded box
    walker.

An .m4v goes to putAsset named .mp4: Apple refuses .m4v by name alone.
The queue and Send to iPhone run the same check, so a refused file fails
at once with why, or goes to iCloud Drive instead.

Containers refused are those outside icloud.com's own upload list (JPEG, PNG, HEIF, HEIC, MOV, MP4, TIFF, GIF, M4V, WebP; docs/icloud-web/photos.md), so avi leaves TYPES. Codec refusals are the ones isynca saw refused live on the same photosupload service (PRs #3, #8, #9). 9 new tests on generated files, including truncated and corrupted input; the wiremock test proves no createUploadUrl for a refused file. Fail-before: 5 of them fail with the checks removed.

Apple only says no to a file once all of it is up, so an AVI, a panorama
past Photos' size or a video in an old camera codec went up whole (up to
500 MB) to be refused. Now a few header reads decide first:

- a photo past 20,480 px a side or 419,430,400 px in all (JPEG, PNG, GIF,
  WebP, TIFF, HEIC through its primary item's ispe), as icloud.com checks;
- AVI, MKV/WebM, MPEG-PS/TS, ASF/WMV, FLV and WeChat WXGF content,
  whatever the file is named; .avi dropped from the types;
- MP4/MOV tracks in MPEG-4 Part 2, Motion JPEG, or camera PCM sound
  (twos/sowt/raw), read from the sample descriptions with a bounded box
  walker.

An .m4v goes to putAsset named .mp4: Apple refuses .m4v by name alone.
The queue and Send to iPhone run the same check, so a refused file fails
at once with why, or goes to iCloud Drive instead.
@YashwanthKamireddi
YashwanthKamireddi merged commit 16d4141 into main Nov 25, 2026
10 checks passed
@YashwanthKamireddi
YashwanthKamireddi deleted the fix/upload-precheck branch November 25, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant