https://bugs.kde.org/show_bug.cgi?id=465972

--- Comment #5 from Noah Davis <noaha...@gmail.com> ---
Git commit 83c9a81f3797140740ef9f31e2e6d4e1174115be by Noah Davis.
Committed on 23/08/2024 at 20:32.
Pushed by ndavis into branch 'master'.

Go back to copying images with setImageData

A previous change was made based on a wrong assumption that you could only
copy one format of image data and that the program doing the copying decides
the format that gets pasted.

The truth is that the app doing the copying gets to decide which formats
are sent to the clipboard and can send multiple types of data, but not which
format gets pasted. Only the app receiving the paste gets to decide which
format gets pasted. If it doesn't support the copied format, nothing will be
pasted. Because of this, images should be copied as uncompressed images. If
you want to paste a JPEG into Firefox/Chromium/Electron apps directly, you
can't really do that. You have to save a JPEG file and then copy the file as
a file URL. I'd like to do that instead so that the copied image can always
be compressed in the preferred format, but Flatpak apps currently can't use
/tmp without the user adding explicit permission specifically for /tmp.

Another issue with trying to copy images directly in the preferred format is
that lossy compressed formats like JPEG will be decompressed when Spectacle
closes, expanding 2-8x their compressed size. This is likely an issue with
Klipper (probably HistoryImageItem) and maybe KSystemClipboard.
Related: bug 485096, bug 465781

M  +26   -20   src/ExportManager.cpp

https://invent.kde.org/graphics/spectacle/-/commit/83c9a81f3797140740ef9f31e2e6d4e1174115be

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to