Dimillian / IceCubesApp

A SwiftUI Mastodon client
https://apps.apple.com/us/app/ice-cubes-for-mastodon/id6444915884
GNU Affero General Public License v3.0
5.57k stars 539 forks source link

Fix the upload of heavy avatar or header image #2103

Closed cschindler closed 5 months ago

cschindler commented 5 months ago

Bug fix

Description

Unable to update the avatar or header account image. The API request fails with the following error code: 422 Unprocessable Entity.

"error": "Validation failed: Avatar must be less than 2 MB, Avatar file size must be less than 2 MB"

According to the Mastodon documentation:

You can upload an avatar as a PNG, GIF, or JPG image up to 2MB in size. This image will be downscaled to 400x400. You can upload a header as a PNG, GIF, or JPG image up to 2MB in size. This image will be downscaled to 1500x500.

Bug reproduced on Ice Cubes version 1.10.42 on iOS 17.5.1

Fix

Tests

Only tested on iOS.