ccd0 / 4chan-x

Adds various features to anonymous imageboards.
https://www.4chan-x.net/
Other
989 stars 135 forks source link

(Data Saver) "Unsupported File Type" when linking images #1241

Open Serarin opened 7 years ago

Serarin commented 7 years ago

I've been using the "Post from URL" feature forever without issues because I really love the idea of hotlinking pictures without having to save them but lately I keep getting a "Unsupported file type" error when linking pictures from certain sites and I have to save the picture if I want to post it or use a different host.

For an example of sites that work, it would be sites like danbooru or twitter. For sites that don't work, it'd be wikis and stuff like this picture for example: http://gbf-wiki.com/attach2/696D67_333034303130353030305F30315F66756C6C2E706E67.png

Directly hotlinking pictures from 4chan doesn't work either which is a real bummer. I cant grab an image from one thread and post it in another without having to save it like I used to do all the time because this feature is broken for me now.

ccd0 commented 7 years ago

You should still be able to post them by ignoring the warning, although you won't be able to see the thumbnail in the dump list. Doing #532 should fix this.

Serarin commented 7 years ago

Just tried it and ignoring the warning did not post the image and instead gave me "Error: Corrupted file or unsupported file type" when trying to post it.

ccd0 commented 7 years ago

What browser and user script engine, if any, are you using?

Serarin commented 7 years ago

I'm using Google Chrome version 55.0.2883.87 m I was using Tampermonkey for Google chrome but I switched to the standalone chrome extension for 4chan X, both presented the problem described above.

ccd0 commented 7 years ago

Are you certain that URL http://gbf-wiki.com/attach2/696D67_333034303130353030305F30315F66756C6C2E706E67.png was one you are having a problem with? I tried it in Chrome, and I didn't see any warning and was able to post the image just fine.

Serarin commented 7 years ago

Yes. Attempting to post that or hotlinking a image from another thread gives me this error. https://my.mixtape.moe/ipuuzx.jpg Using 4chanx 1.13.2.3 Extension + OneeChan v5.6.1

ccd0 commented 7 years ago

For the Chrome extension, could you do the following?

Go to chrome://extensions/ Tick the "Developer mode" checkbox, then click the "background page" link for the 4chan X entry. Switch to the "Network" tab in the Developer Tools dialog that appears, then open 4chan in another tab and load an image from a URL in the Quick Reply. Going back to the Developer Tools dialog, there should be a new entry from the URL you loaded. If it isn't there, try again with "?something" added to the end of the link Click it and copy/screenshot the details in the "Headers" tab, particularly the response headers.

Also, are you using any other extensions? Try temporarily disabling them to see if one of them is causing a conflict.

Serarin commented 7 years ago

Image that refuses to post: https://my.mixtape.moe/xiuyns.jpg

Image that posts without issues: https://my.mixtape.moe/eqipsg.jpg

Same image that refuses to post with all extensions disabled: https://my.mixtape.moe/epxxul.jpg

Still refused to post even after disabling all my extensions.

ccd0 commented 7 years ago

The problem you're having is due to the Chrome Data Compression Proxy converting the images to WebP. I'll put a workaround on the beta version shortly, but for now, disabling that and clearing your cache should make posting images from URLs work.

ccd0 commented 7 years ago

I tried to work around the issue, but it didn't work very well. 4chan X would request images in a post-able format using the Accept header, but if you had opened the image already, it would already be cached in WebP format, and that's what 4chan X would get. So I reverted the workaround.

I could have 4chan X request non-cached images, but that would adversely affect users not using Google's Data Saver proxy.

This is something that needs to be fixed on Google's end. At that point, we can revisit this. Until then, the solution is to not use Data Saver.

Serarin commented 7 years ago

Disabling data saver and clearing cache has fixed my issue and I can make full use of the post from URL feature now. Thank you very much or the assistance.

ccd0 commented 7 years ago

I opened an issue upstream: https://crbug.com/679175