We are getting image dimensions error from twitter api

restapi
media-upload
api

#1

{“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)


#2

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?


#3

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?


#4

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”.


#6

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 :
{“media_id”:760101781451833344,“media_id_string”:“760101781451833344”,“size”:2854274,“expires_after_secs”:86400,“image”:{“image_type”:“image/jpeg”,“w”:1400,“h”:10000}}

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?


#7

Any update on this?


#8

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


#9

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


#10

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


#11

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.


#12

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.


#13

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.


#14

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


#15

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.


#16

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