I have a similar problem.
I can upload an animated gif with a size of 7MB with twurl. But when I try to attach it to a tweet, I get an error related to the size.
twurl -H upload.twitter.com -X POST "/1.1/media/upload.json" -f "test.gif" -F "media" | jq
{
"media_id": 940648334259294200,
"media_id_string": "940648334259294208",
"size": 6669298,
"expires_after_secs": 86400,
"image": {
"image_type": "image/gif",
"w": 580,
"h": 424
}
}
Then
twurl -d "media_ids=940648334259294208&status=test animated gif" /1.1/statuses/update.json
{
"errors": [
{
"code": 324,
"message": "Image file size must be <= 5242880 bytes"
}
]
}
Why Twitter allow the gif to be uploaded in the first place but refuse to attach it with a Tweet?