Fri, Apr 12
P370 (Warning may write many files)
All judging from file sizes:
JPG/JPEG: Quality has an effect
PIC: compression 0 disables compression (enabled by default?)
PNG: see above
TIF/TIFF: same as PIC
WEBP: only quality seems to have an effect
JPEG 2000 and WebP are other (somewhat less popular) lossy formats. The Qt format writers switch to lossless mode for quality 100, see https://code.qt.io/cgit/qt/qtimageformats.git/tree/src/plugins/imageformats/webp/qwebphandler.cpp#n251 and https://code.qt.io/cgit/qt/qtimageformats.git/tree/src/plugins/imageformats/jp2/qjp2handler.cpp#n827
Thu, Apr 11
I looked into Qt and it actually uses compression. It just falls back to quality if compression is not set. See: https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/image/qpnghandler.cpp#n1075
I did a quick test P367 and it seems to work. The question now is do we want to special case this for png to not accidentally break another format (would be a quick fix) or to enable it for all formats that support it. In my opinion if we do the latter we should now do testing (maybe automated?) to not run into weird quality/compression interactions for other formats.
@nrother Do you want to fix it for 19.04.1?
+1, please push to stable.
Wed, Apr 3
- remove setup shortcuts
@davidedmundson is /usr/share/kglobalaccel the correct folder?
Could this be part of the problem?
It seems for the png implementation setQuality also sets the Compression instead of setCompression:
Where is the check that this is done only for lossy formats? Here, PNG is saved uncompressed after this change.
Tue, Apr 2
That's where my confusion here and in D20180 is coming from. Isn't it always added unconditionally in ExportManager::doCopyToClipboard? And both the button regardless of quit after copy and spectacle -b -c go through that. Or am I missing a place where copying is done?
You're right. There seems to be some magic involved. If I wait 250 ms and directly quit like KSMainWindow did it works. Testing master I also found that spectacle -b -c does not work and if you copy to the clipboard and then exit manually the image doesn't appear Klipper.
Now to figure out the reason
Testing master using quit after copy works but doing spectacle -b -c does not. Can you confirm?
Mon, Apr 1
Thanks, a nice refactoring. However in testing this broke the "quit after copy" feature; now the image is no longer added to klipper when this setting is used.
Tue, Mar 26
Broken feature? What doesn't work? I tested it out and it worked fine for me.
Because of the broken feature and string freezes, the commit was reverted in Applications/19.04, while still part of master (so it will be part of Applications 19.08).
Thanks, this works great. Spectacle actually does exit correctly after using the -c option, but it just takes it a few seconds because it has to be running while the notification is visible. I think that's fine.
Sun, Mar 24
Use arcanist to get context
Fair enough. Let's refactor in another revision.
Update doCopyToClipboard function with the "x-kde-force-image-copy" mime type hint.