jscher2000 / Save-webP-as-extension

Firefox extension to overlay format and JPEG quality buttons on inline or stand-alone images for quickly saving a converted version of the image.
Mozilla Public License 2.0
32 stars 1 forks source link

Image cut off when saved as PNG / JPG. #10

Open SVNKoch opened 2 years ago

SVNKoch commented 2 years ago

I wanted to save the main image of the pan on this site. However the result was: bratpfanne_800x_png No matter if PNG or JPG. Saving as IE 11 however worked without removing half the lid on the right. The correct image is 800x800. The downlaoded ones are 660x660. Even Button bar > Info displays Size as 660x660. When first left clicking the image to open an enlarged version than it works. The result is the correct 800x800 image.

=> Bug: Why cut off? +Feat Request: Allow Save as IE 11 as Perform Default Action Entry

jscher2000 commented 2 years ago

Bug: Why cut off?

Hmm, good question. The img tag uses a srcset attribute to encourage browsers to substitute an image suitable to the window width (I think that is how it works). But the size selection and scaling should NOT override the "natural" width and height of the image. Yet I see in some cases as I resize the window, Firefox is reporting 660px square as the natural size for both the 700px and 800px images. There must be something unusual about the design of this page that is fooling Firefox?

Not sure whether I can track down what is going on, I might need to file a bug.

+Feat Request: Allow Save as IE 11 as Perform Default Action Entry

I think I can do that. Might take a while to work on it.

jscher2000 commented 2 years ago

I added IE 11 as a menu item option in tonight version 1.2 update. If you try it out, let me know what you think.

DarkwaterV3 commented 1 year ago

Sorry to necro this, but in Firefox I can work around this by first opening the image in a new tab and then saving them.

Some images/sites are resistant to opening in a new tab, but the Search By Image extension has a tool that can work around that in turn.

https://github.com/dessant/search-by-image

jscher2000 commented 1 year ago

Sorry to necro this, but in Firefox I can work around this by first opening the image in a new tab and then saving them.

If you find a current example of the problem, could you share a URL? The original site in this thread seems to work differently now.

Karoken commented 3 weeks ago

Hey, just following up. You recently replied to my review where I had the same issue.

For me, it seemed like opening it in a new tab didn't resolve the issue. If it helps, I encountered this when moving content from a Medium blog to another platform, with Medium being all webps. The images in question: https://imgur.com/a/4R49nsc + URL: https://medium.com/@layer_ai/layer-ai-becomes-a-unity-verified-solution-5a602a566fe7

It seemed to eventually "resolve" itself but thats after trying a few times, i dont have a direct repro. Happy to provide any info you need., just let me know.

jscher2000 commented 3 weeks ago

For me, it seemed like opening it in a new tab didn't resolve the issue. If it helps, I encountered this when moving content from a Medium blog to another platform, with Medium being all webps. The images in question: https://imgur.com/a/4R49nsc + URL: https://medium.com/@layer_ai/layer-ai-becomes-a-unity-verified-solution-5a602a566fe7

The site uses a <picture> tag with two <source> tags, each with a srcset attribute listing images for a variety of screen widths. I need to study these picture/source/srcset tags in more detail to see whether I can detect/avoid sizing problems. But also, at least in this case, they have the non-WebP images (they're JPEG) in the second source tag. This is the largest one, which may or may not be the original:

https://miro.medium.com/v2/resize:fit:1400/0*F_DIi-WAjTNW_hpJ

I need to add picture/source decoding so you can access that list of images, so maybe that will provide a quick workaround for this issue if I can find an easy way to implement it. (I know it's going to take many hours so I've been putting it off.)

For your particular result shown on Imgur, I can reproduce it by clicking the image to enlarge it before displaying the bar. The button bar also gets absurdly enlarged. I think this issue is related to changes in Firefox 126 related to CSS Zoom. I'll need to figure out some kind of workaround. I'll probably create a separate issue for that.

jscher2000 commented 3 weeks ago

I submitted an update to the Add-ons site. It's taking about 5-7 days to review new versions recently.

Meanwhile, for Medium, if you open the large image in a new tab and delete format:webp/ from the URL by hand, the server will send you a legacy format. At least on the two I tested.