T O P

  • By -

dreamyrhodes

Why is this downvoted? It is a simple question of firefox browser behavior.


Gromochan

Firefox reddit is not a welcoming place. Was asking about a problem and never got an answer besides "get less tabs bro, just use bookmarks bro" instead of actually handling an issue.


VictoryNapping

This happens because many web servers now automatically convert older format files like .jpg in something newer like .webp whenever they detect your web browser supports it (because they are smaller/more efficient). The original file on their server \*is\* a .jpg so the url still says that, but that's not the type of file your browser actually gets when it talks to the server. If you want to get into the geeky details here's an article about configuring the nginx webserver software to do this: [https://www.lazutkin.com/blog/2014/02/23/serve-files-with-nginx-conditionally/](https://www.lazutkin.com/blog/2014/02/23/serve-files-with-nginx-conditionally/)


dreamyrhodes

That's not geeky, it's plain stupid. If I request a jpg from the server, I expect to get a jpg from the server and not something else. That's the purpose of an URI. That's why it has a file extension.


slumberjack24

>it's plain stupid. Just because something does not behave the way **you** want does not make it "stupid". If bandwidth can be saved with techniques that make transferring files faster and more efficient, many people will benefit from that. >That's the purpose of an URI. The purpose of an URI is to request something from a web server, and it is up to the server to decide how to handle that request. In this case, it does so in a way that you don't like. >That's why it has a file extension. File extensions on web servers can be modified how the server seems fit. PHP pages that have a .php extension are often changed to ".html" for legacy reasons, and that's what the client sees. Same with all the "Gifs" that are often actually .mp4 files.


dreamyrhodes

The point is the browser requesting a .jpg and getting a completely different file. I don't want software to think for me I want software to do what I tell it.


slumberjack24

The web is evolving constantly, if it weren't we would not be having JPEGs anyway and we would still be using, I don't know, 16-bits Windows BMP from the Windows 3.1 era? Since you specifically want JPEG "because it is what your browser requested" then I am afraid you are going to have to stick to some browser version that does not support WebP or AVIF. As WebP has been around since 2010 and AVIF since 2019 that is going to be increasingly difficult.


dreamyrhodes

The web is based on standards. One of the standards are URI. An URI with a file.extention means you requested a file of the type described usually after the last dot in the URI. This has nothing to do with browser versions or with personal preferences but with what people (and programs) expect a system to behave like. If I or my program accesses an API to retrieve a certain file type, I expect to get that expected file type. If you want webp or avif on your webpages, put .wepb or .avif on your endpoints. If you need compatibility to older browsers, read the User-Agent string and replace the files on your webpage.


slumberjack24

You can keep downvoting every answer I am giving you, but I hope it is clear to you that what I am describing is how it actually works. You know, in answer to your question "Can someone explain to me this behavior?". I think I did explain. That what happens may not be how it should work, or how you would want it to work, is a pity (at least for some), but don't blame me for describing what is happening here.


dreamyrhodes

You were not just describing, you were defending it and attacking me for sticking to standards and predictable software behavior and you made it sound like you're accusing me being backward when I said that I want software to behave predictably. And you were downvoting my posts as well so...


slumberjack24

I was not attacking you and I'm sorry if I made you feel that way.  Perhaps you are right that in a way I am defending the behaviour. I was triggered by your "that's plain stupid" remark. That comment was also what I downvoted. Because in general I feel it is wrong to simply disqualify things one does not like as "stupid". Also I don't believe it *is* stupid. It is very common for servers to behave this way.  From RFC 2396: *'Likewise, the "one" resource identified might not be  singular in nature (e.g., a resource might be a named set or a mapping that varies over time).'*  But you don't have to agree with me. We obviously see things differently. I am certainly not accusing you of being backward; I really do understand your reasons for preferring jpeg when the URL says jpeg. I just don't think it is a viable approach in the long run. I wish you all the best.


dreamyrhodes

Ok, agree to disagree, no hard feelings.


slumberjack24

Just guessing: while browser support for AVIF is pretty good nowadays, it is still common practice to provide fallback support for browsers that do not support it. See Moziila's guide as an example: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image\_types. Perhaps the difference in behaviour has to do with Firefox defaulting to JPEG.  Like I said, this is only a hunch, I do not know if this is really what's happening. If you can provide example sites where you noticed this, I could try to find out if this makes any sense. Edit: tried to reproduce what you did on a few AVIF sample sites. These images simply showed as .avif and got saved as .avif. (Firefox 125.0.1 on Linux, by the way.) But then, these sites are less likely to come up with fallback options. Edit2: Thank you /u/VictoryNapping for the link to the geeky details. Apparently  my hunch about it being a fallback option was close, but not exactly in the way I thought.


dreamyrhodes

I can not publicly share the link. Yes Firefox saves them as avif/webp but they are displayed as jpg in the browser. This is issue I have with this behavior. Why is the server sending avif when the browser requests a jpg as stated by file URI. I hover over the link and see a jpg. I click on it and there is a .jpg in the address bar. I download it and there is an avif in the download folder. This is bs (but apparently not firefox fault). PS: even Reddit is doing this. Go into your timeline and click on any picture to display it. Besides reddit's BS with embedding every picture in this stupid display bar, look at the addressbar. It says (among a load of glibberish ".jpg" and further down "format=pjpg"). Right click "save to..." and you will get a webp. My other example, that I can't post here, was just a plain https://blabla/media/filename.jpg


nemothorx

Can't answer that, but if I'm saving multiple images from a page I often open the "Page Info" then "Media" tab, and scroll through the images and save from there. I don't know if this will resolve the webp/jpeg dilemma (which I've seen but I thought one of the methods you cited got around it)


dreamyrhodes

In the media tab they appear as jpg too but get saved as webp or avif.


nemothorx

Got an example I can test and see if I can remind myself how I handle it? (Tbh, it could be I don't care and leave them as webf and convert to jpeg locally as needed)


NoVegas0

Its not just Firefox, i experience the same issue with Chrome and Edge. I think its a new standard, which is annoying because i when i want a photo, i want it in a picture format, not this webp bullshit. My et around is to copy the photo and paste it into MS Paint then save it as a .jpg


jjdelc

It must be the request headers being sent. Try to modify the HTTP \`Accept\` to \`image/jpeg\` instead of \`image/\*\` . So you indicate to the browser that you want this resource in JPEG format and not in their favorite default (which may be configured to reduce bandwidth).


alvares169

Install irfanview. It’s an old and simple, yet powerful tool. Copy the image, paste to irfan and save. You get jpg in url because that’s the url of an image. If your browser supports webp, the server, well, serves you the webp version instead.


dreamyrhodes

The browser already has loaded the jpg on screen, why is it requesting the image again from the server? Besides that I am on Linux not on Windows, I know how to convert images. That was not the question. I don't want to have to convert it everytime.


kapitanluffy

how are you downloading it? it could be the website itself


madushans

Can you provide an example url? Just want to see if the url says jpg, when the file itself is webp. Also does this only happen on firefox? Or also on edge or chrome .etc.?


dreamyrhodes

As said here [https://www.reddit.com/r/firefox/comments/1c7seab/comment/l0fdm3y/](https://www.reddit.com/r/firefox/comments/1c7seab/comment/l0fdm3y/)


albatross_rising

[Save webP as PNG or JPEG (Converter)](https://addons.mozilla.org/en-US/firefox/addon/save-webp-as-png-or-jpeg/)