I just made a post copy-pasting images from another tab. All jpegs became pngs, for example 1.3MB became 6.4MB.

If I save the image first, then upload to Lemmy, it stays as a jpeg. What causes the pointless converting when copy-pasting? Can it be stopped from happening?

  • @RookiA
    link
    613 days ago

    Hi,

    this is done by pict-rs ( the image hosting middle man that lemmy uses ) it converts every image uploaded to png. Only way of keeping a jpg is using a external image hoster ( like imgur ) and just embeding the link here.

    Thanks

    • @TehdastehdasOP
      link
      English
      1
      edit-2
      13 days ago

      But why does it convert only when using copy and paste? Via download and upload, the jpeg stays jpeg.

      The converter can see it was smaller before the conversion. Why not save the smaller jpeg? Who needs pngs, no matter how wasteful?

      I’d guess Firefox takes a screenshot when I try to copy an image.

      • @RookiA
        link
        113 days ago

        I guess if its only then thats a lemmy “feature”.

  • @Zachariah
    link
    3
    edit-2
    13 days ago

    Are you pasting the file or the image data?

    If you’re opening the image, and copying the file’s contents, I could imagine it becoming uncompressed bitmap data to be stored on the clipboard rather than the clipboard containing lossy compressed image data. When pasting the contents somewhere, you can’t count on the destination handling jpeg data as often/reliably as you can count a destination being able to handle bitmap data.

    edit: I hit the wrong reply button, but I guess this stands alone fine as it is.

    • @TehdastehdasOP
      link
      English
      2
      edit-2
      13 days ago

      In Firefox I right-click the image and select “Copy”. In the same window in the other tab I hit Ctrl-V.

      Surely it sends the file from the local cache folder?

      • subignition
        link
        fedilink
        113 days ago

        No. When you copy an image like that you’re copying the image data to your clipboard, not the file.

  • @Zachariah
    link
    213 days ago

    What OS are you using? Perhaps it’s being converted because of limitations of the clipboard?

    • @TehdastehdasOP
      link
      English
      113 days ago

      Linux Mint Cinnamon.

      Surely all clipboards pass any file without touching the insides? That’s the only easy way to make a clipboard.

  • Daemon Silverstein
    link
    fedilink
    213 days ago

    This seems to be a Javascript thing, not a Lemmy thing. IIRC, everything that’s pasted triggers the onpaste event with a “image.png” file/blob, regardless of the source format.

  • @Etterra
    link
    -113 days ago

    Probably because a PNG takes up less storage space.