Topic: File not uploading despite being a Jpg?

Posted under General

I've been trying to upload art that I've downloaded off reddit here. However, the past couple of times, the error that the images are an invalid format keep popping up. But image files downloaded off reddit say they are JPG's, which the error says is allowed. I would normally screenshot the image to turn it into a PNG, but that would make the image quality worse and I already have the correct file type supposedly. Do yall have any ideas?

Can you provide the entire error message? And the place you got the files.

snpthecat said:
Can you provide the entire error message? And the place you got the files.

I was downloading the images off of reddit as I said before. As for the error message, its "error: ActiveRecord::RecordInvalid - Validation failed: File ext image/webp is invalid (only jpg, png, gif, webm, and mp4 files are allowed)"

Then the image file is probably webp. Did you just rename the file extension while keeping it as webp

snpthecat said:
Then the image file is probably webp. Did you just rename the file extension while keeping it as webp

I'll try that, thank you!

You can also try changing the header's accept parameter to image/png or image/jpeg. Examples here of what I'm talking about. I use ModHeader extension but you can do it manually using the DOM Inspector.

"Just because you rename a file it doesn't convert their file format." LOL, no shit. Any of the ideas like resaving are also non-starters. You want to hope you get lucky and the server just hands you a higher-quality JPEG (often works) or PNG (almost never works but worth trying).

Hmm, interesting results , here.

Updated

planttentacles said:
downloaded off reddit

I wanted to link to howto:sites and sources but there really is nothing on how to source from reddit despite the direct upload whitelist having their domain (specifically, i.redd.it/) whitelisted. weird, but ok

Get the filename from either the thing you downloaded (change filename, copy the text and don't actually change it) or by going to the page you got the image from (right click on the image and select "copy image link"). It should be a collection of random letters a-z and numbers 0-9. Then, put the filename at the end of https://i.redd.it/ so it becomes https://i.redd.it/(filename).(extension). If you downloaded it converted to .webp, you might need to guess what the actual format was, so try .png .jpg .jpeg and .gif (not sure if there's more supported).
If the image loads in your browser, you're in the right place, but reddit will blast the address into https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2F(filename).(extension). You can already download the original from that address by rightclicking the image, but you can also make use from the whitelist when uploading - just remake the address back to the i.redd.it/ form and don't enter into it, just copy and paste it into the url bar in the upload page to have e6 servers do the downloading.

Example addresses:
https://i.redd.it/jqp9uvw589he1.jpeg
https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2Fjqp9uvw589he1.jpeg

Reddit needs three things fixed make it Just Work:

"Accept image/* header" tweak otherwise it serves useless HTML

Redirector extension otherwise you get preview sizes

Reddit source images
Redirect: https://preview.redd.it/*?width*
to: https://i.redd.it/$1

Referrer Control extension otherwise it again wants to serve HTML

https://i.redd.it to/from https://www.reddit.com

Original page: https://e621.net/forum_topics/59270?page=1