Why do pasted png get converted to jpg

I wanted to ask about this commit. Why do pasted PNGs get converted to JPG in any case? what breaks without this commit? why is it called FIX?
Thank you very much :smiley:

See Screenshots: JPEG vs. GIF (and PNG)

1 Like

I am sorry, but I can not find the answer to my question in your link. My question is not why pngs get converted to jpg, my question is: why do pasted PNGs get converted to JPGs? I dont understand why there is a difference between pasted and non pasted.
Thanks :smiley:

Pasted images typically come across as raw bitmaps, so saving them all as PNG (lossless) would be hugely wasteful in file size. Instead we test saving in both formats and see which results in a “reasonable” size, so (most) images end up efficiently stored as JPGs (lossy).


Thank you for your answer! I think I start to understand this now.


Content-Disposition: form-data; name="type"



Content-Disposition: form-data; name="files[]"; filename="Screenshot_2020-05-05.png"

Content-Type: image/png

How can I reproduce this? I used the inspector and looked at the request and saw this when pasting a png, when I tried with a jpg it will say image/jpg. What does raw bitmap mean? With which browser does this happen (I use firefox)?

EDIT okay never mind, I think maybe I misunderstood what pasted means. I actually did drag and drop. I tried to copy and paste an image, but it seems like it does not work in general on my system. It just adds this text to the the composer: