4MB Static GIF Failing using twurl

image
api
filesize

#1

Hi,
We are facing an issue wherein we are trying to upload a 4MB image using twurl socialassets.adobe.com/20170602081249304925.gif (resized to 4MB). We are getting an error
Uploading Media : twurl -H upload.twitter.com -X POST “/1.1/media/upload.json” --file “/Users/hug32053/Desktop/TestImageDimensions.gif” --file-field "media"
Response:
{“media_id”:874249293762240514,“media_id_string”:“874249293762240514”,“size”:4042763,“expires_after_secs”:86400,“image”:{“image_type”:“image/gif”,“w”:3556,“h”:2000}
After Posting through twurl “/1.1/statuses/update.json” -d “media_ids=874249293762240514&status=Sample Tweet with media_ids and twurl”
{“code”:324,“message”:“Image file size must be <= 3145728 bytes”}] for this image.

What is the limit on Image Size for uploading a static gif? As per our knowledge, it is 5MB? What constraints are taken into picture?


#2

The limit for GIF uploads is 15Mb, however to exceed 3Mb you must use the chunked upload method rather than attempting to upload in one shot. You can use the large video upload sample for reference, changing the file type to image/gif and the media category to tweet_gif.


Image Size Limit when uploading using api
Max Photo Size
#3

Thanks Andy !! One more thing, Is there any image dimensions limit for the static images- jpeg, png and gif?
I see there is a limit on animated_gifs -Resolution should be <= 1280x1080 (width x height). Just want to be sure, that we aren’t missing any other constraint parameter for static gifs.


#4

In case of animated images, we are uploading the images in one shot but this error is occuring on static GIF’s . Does it mean , we don’t need chunked upload method for animated_gifs because its size limit is 5 MB. Static GIFs also have 5MB size limit? What is the difference between size limit for static and animated gifs?


#5

Images in general have a limit of 3Mb. 5Mb images may be uploaded but only images <= 3Mb may be attached to a Tweet. See the documentation.

Image files must meet all of the following criteria:

Supported image media types: JPG, PNG, GIF, WEBP
Image size <= 5 MB, animated GIF size <= 15 MB
The filesize limit above is enforced by the media upload endpoint. In addition, there is a separate product entity specific filesize limit which is applied when calling the Tweet creation (or similar) endpoints with media_id. For example, it is possible to upload a 5 MB image, but the Tweet creation requires images to be <= 3 MB. The filesize limit and other constraints may vary depending on the media_category parameter.