We are getting image dimensions error from twitter api



{“errors”:[{“message”:“Image dimensions must be >= 4x4 and <= 8192x8192”,“code”:324}]}

/1.1/media/upload.json In this endpoint i got media id. But after trying to upload tweet with this media id, im getting the above error. Any changes in media upload api?

Ex media id: 727120710510858240 (jpeg image)


The only changes that I am aware of are more expressive error messages like the one you’ve shown here. Is your image within the limits that are being stated, or do you think this is a mistake?


Hi, image size is below 3MB ==> 2.854274 MB. Also before its not like this, any change regarding dimensions? We should check dimensions also while uploading image?


No changes that I’m aware of. The Uploading Media guide has details on limits for animated GIFs and videos, but we haven’t listed out image sizes there. The only other thing we’ve recently announced is the forthcoming changes to image resizing. I think the main difference here is that the API now returns clearer error messages, while before it would have simply said something like “invalid media ID”.


Hi, Again we are getting same error response while uploading image with media id . (this image less than 3 MB , also not GIF) .

Response from media upload :

While uploading with media id : (https://api.twitter.com/1.1/statuses/update.json?media_ids=760101781451833344)
got this error: {“errors”:[{“code”:324,“message”:“Image dimensions must be >= 4x4 and <= 8192x8192”}]}

Any changes in image upload api?


Any update on this?


Hi,Any update regarding this issue? Please look into this.


No changes that I’m aware of, can you provide a link to the problematic image?


This is the response we got while uploading image , please use media id: 760101781451833344


That media ID will have expired by now, so I was asking if you could please make the actual image file available somewhere via a URL so that our team can investigate. Thanks.


Hi , Example image I uploaded here, pls check using that.I can able to post this in twitter directly , but in api im receiving above error which i mentionedd earlier.


Right, so this image is 9162 pixels wide. The error that you received shows that the maximum dimensions in either direction is 8192 pixels. I just cropped your image to 8192 wide, and it uploads and attaches to a Tweet successfully.


Yes, But Twitter didnt mention anything about this dimensions in their api documentation. You also said that there is no changes.


That’s true, I said that I was not aware of any changes, and I also said that the dimensions for images are not currently listed in the documentation - that’s something we can improve in the future. The error message itself is pretty clear about the permitted dimensions.


Okay , Thank you very much for your response. :slight_smile: