bridgy icon indicating copy to clipboard operation
bridgy copied to clipboard

twitter publish: flickr images missing file sizes (Content-Length header)

Open jgmac1106 opened this issue 5 years ago • 9 comments

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

jgmac1106 avatar May 13 '20 11:05 jgmac1106

Actually happening to all the flickr images, now. So original theory off....https://live.staticflickr.com/722/21071079262_293e069548_z.jpg

jgmac1106 avatar May 13 '20 11:05 jgmac1106

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.

snarfed avatar May 13 '20 14:05 snarfed

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

jgmac1106 avatar May 13 '20 15:05 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 avatar May 13 '20 15:05 Ryuno-Ki

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

snarfed avatar May 13 '20 15:05 snarfed

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.

snarfed avatar May 18 '20 06:05 snarfed

no answers in the discussion group. not sure what to do next. 😐

snarfed avatar May 24 '20 17:05 snarfed

I guess the alternative here is to download the whole image from Flickr into memory, instead of streaming. I guess we could do that.

snarfed avatar Sep 02 '21 14:09 snarfed

Haven't heard any other complaints about this recently. Bridgy Publish Twitter with Flickr image URLs is probably a very rare use case.

snarfed avatar Jan 12 '23 05:01 snarfed

Obsolete, Bridgy Twitter is dead. https://github.com/snarfed/bridgy/issues/1410#issuecomment-1497763725

snarfed avatar Apr 06 '23 04:04 snarfed