I am POSTing with base64-encoded data in the
media_data parameter to media/upload. This usually works fine, but there are some images that seem to sometimes succeed and sometimes fail.
This one uploaded fine, even though I have confirmed it is byte-for-byte identical to the second image above:
Any hints what might be wrong here? The fact that it usually works - and sometimes even works with exactly the same data - makes me suspect a problem on Twitter’s side.