My project use TwistOAuth (GitHub - mpyw-junks/TwistOAuth: Warning: This package is abandoned and no longer maintained. Use mpyw/cowitter package instead.)
to upload a jpg image. But it’s failed.
Error
Code:400 Message:media type unrecognized
Endpoint: https://upload.twitter.com/1.1/media/upload.json
The point is, this is failed with only one image. The other images was uploaded successfully.
That fail-to-upload image is opened normally in my Mac but occurred error when opened with Photoshop
Error that show in Photoshop
The embedded ICC profile cannot be used because the ICC profile is invalid.
Can you confirm that problem when upload is from my image?
Is that Twitter does not handle ‘Invalid ICC profile image’?
(Is there anyway I can show you the image? Because I don’t want it to be public)
Thank you!
1 Like
The first thing I noticed here is that the library you are using is no longer maintained and an alternative is recommended - however, that should have no impact on image handling.
- Are you able to attach the image and Tweet it from twitter.com (rather than using the API?)
- have you tried stripping the ICC profile (using eg ImageMagick or exiftool) before using the API to upload?
It seems likely that this damaged profile is the cause of the error.
1 Like
Thank you for your response.
I was able to attach that image a Tweet successfully
It seems that I cannot strip the ICC profile.
Because this “may be damaged” image is from my client. They use my web app to upload their image.
If I copy and paste to make another image on my mac. The pasted image was uploaded successfully via API.
Can you give me some more advice for this situation?
Can you give me some more advice for this situation?
Is it possible to get them to re-upload the image? or alternatively change your upload script to re-save and optimize the image so it’ll upload correctly?
Sorry for late response.
I can use that image to tweet on my test account. Still cannot tweet that image.
I think I can do it.
But problem here is “why I cannot upload that image?”
I want to know the reason is Twitter API cannot handle that image or not.
1 Like
@andypiper Can you test uploading my image via Twitter API? (I can give you that image somewhere private)
Thank you.
system
Closed
#7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.