twitter publish: flickr images missing file sizes (Content-Length header)
Not sure why (think artist not entering info) but whenever I try to use one of these doodles https://live.staticflickr.com/65535/49734027238_225b2a037c_z.jpg I get an error that bridgy can not determine file size
Actually happening to all the flickr images, now. So original theory off....https://live.staticflickr.com/722/21071079262_293e069548_z.jpg
thanks for filing! specifically, the problem here is publishing to twitter. twitter has a 5MB limit on images, so bridgy checks the source image file's Content-Length HTTP header before uploading it. evidently flickr doesn't serve that header on its photos, so bridgy chokes and errors out.
the fix here is to go ahead and try anyway if Content-Length is missing, and fail gracefully if it hits the size limit.
Strange as both images are drastically smaller than 5MB.
I always used embedded flickr images, the real fix will be to download and self hot the images, but I wonder flickr changed to strip file size from the header.
On Wed, May 13, 2020 at 10:55 AM Ryan Barrett [email protected] wrote:
thanks for filing! specifically, the problem here is publishing to twitter. twitter has a 5MB limit on images https://developer.twitter.com/en/docs/media/upload-media/uploading-media/media-best-practices#image-specs, so bridgy checks the source image file's Content-Length HTTP header before uploading it. evidently flickr doesn't serve that header on its photos, so bridgy chokes and errors out.
the fix here is to go ahead and try anyway if Content-Length is missing, and fail gracefully if it hits the size limit.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/snarfed/bridgy/issues/944#issuecomment-628045583, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQL5JTS4ERMM6Z6JNHYK2TRRKYE5ANCNFSM4M7VOSNA .
-- J. Gregory McVerry, PhD Assistant Professor Southern Connecticut State University twitter: jgmac1106
Do you happen to know, whether Bridgy is temporarily downloading the images? In that case, the Filesystem should be able to tell the size of the image.
@Ryuno-Ki true! sadly no, they don't hit the file system. bridgy streams them in memory from the HTTP response directly to the twitter upload API request.
ugh, i forgot the bigger reason i need Content-Length: twitter requires the file size in bytes before i can start uploading.
@jgmac1106 any chance you could annotate your u-photos with their size in bytes, maybe in p-size? details in https://indieweb.org/size . pretty hack fix, but i'd happily read and use it from there.
no answers in the discussion group. not sure what to do next. 😐
I guess the alternative here is to download the whole image from Flickr into memory, instead of streaming. I guess we could do that.
Haven't heard any other complaints about this recently. Bridgy Publish Twitter with Flickr image URLs is probably a very rare use case.
Obsolete, Bridgy Twitter is dead. https://github.com/snarfed/bridgy/issues/1410#issuecomment-1497763725