Commit 96e46cf
fix(tiktok): correct picture_size_check_failed message and pre-check image sizes
TikTok returns fail_reason `picture_size_check_failed` when media violates its
size rules, and we mapped it to "Video must be at least 720p, Picture must no
exceed 1080p". Both halves were wrong or unhelpful: TikTok documents no minimum
for photos, "1080p" never said which dimension, and the 720p video claim has no
basis in the docs.
A customer hit this on TikTok carousels created through the public API. Her
images were 941x1672 (valid), but each failing carousel also contained a
1086x1448 image - 6px over the 1080 limit on the shorter side - and a single
oversized image fails the entire carousel. TikTok never reports which image
failed, so the generic message sent her resizing images that were already fine.
Verified against the real API on a connected TikTok channel, uploading through
the public API so the media reaches TikTok at its original dimensions:
480x640 -> PUBLISHED (disproves the "at least 720p" claim)
320x320 -> FAILED (picture_size_check_failed, confirms the 360 floor)
5000x5000 -> PUBLISHED (TikTok does not enforce its documented 4096 max)
The message therefore claims only what was verified: the 1080 image ceiling and
the 360 video floor. The documented 4096 ceiling is omitted because TikTok
accepted a 5000x5000 video.
`checkValidity` now measures photos up front and names the offending image, so
the failure surfaces at save time instead of hours later at publish. It mirrors
the existing Pinterest check and reuses `getImageDimensions`. Videos are not
pre-checked: there is no ffmpeg dependency server-side, so video size still only
surfaces at publish through the corrected message.
Already-scheduled carousels are not re-validated - `checkValidity` only runs on
create/update - so existing invalid posts will still fail at publish, now with
the corrected message.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent cef5d2e commit 96e46cf
1 file changed
Lines changed: 18 additions & 1 deletion
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
70 | 86 | | |
71 | 87 | | |
72 | 88 | | |
| |||
255 | 271 | | |
256 | 272 | | |
257 | 273 | | |
258 | | - | |
| 274 | + | |
| 275 | + | |
259 | 276 | | |
260 | 277 | | |
261 | 278 | | |
| |||
0 commit comments