Bug 473629 - Copied images have Mimetype "application/x-kde-onlyReplaceEmpty"
Summary: Copied images have Mimetype "application/x-kde-onlyReplaceEmpty"
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (show other bugs)
Version: 5.27.6
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2023-08-22 10:25 UTC by Henning
Modified: 2023-10-07 23:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henning 2023-08-22 10:25:35 UTC
1. take a screenshot with spectacle
2. Ctrl+V to Dolphin
3. The mimetype is "application/x-kde-onlyReplaceEmpty" and the file is not recognized by apps, naming it "*.png" also doesnt fix it.

Interestingly copying to Libreoffice (Flatpak) works normally.

What should happen?
Spectacle saves Screenshots as PNG afaik, so this should be the mimetype

--- Software ---  
OS: Fedora Linux 38.20230821.0 (Kinoite) 
KDE Plasma: 5.27.6 
KDE Frameworks: 5.108.0 
Qt: 5.15.10 
Kernel: 6.4.11-200.fc38.x86_64 
Compositor: x11
Comment 1 Henning 2023-08-22 10:25:53 UTC
related closed bug: https://bugs.kde.org/show_bug.cgi?id=465178
Comment 2 David Edmundson 2023-08-22 11:19:13 UTC
>3. The mimetype is "application/x-kde-onlyReplaceEmpty" and the file is not recognized by apps, naming it "*.png" also doesnt fix it.

The mimetype should be a list of things. A bunch of image formats and this one thing.
That hint is a workaround for a wayland protocol race condition. 

I would expect all clients to ignore it and choose one of the mimetypes they do know (image/png for example), can you expand on how you saw this was the issue?
Comment 3 Nate Graham 2023-08-22 20:45:24 UTC
.
Comment 4 Henning 2023-08-22 22:38:14 UTC
Yes, I can choose a mimetype in dolphin I want to choose. But just pressing "Enter" keeps it in an unusable format.

When I dont give an extension its a textfile containing "1"

When I give extension .png, XNViewMP still cant open it for some reason, same in Gwenview RPM
Comment 5 Nate Graham 2023-08-23 15:43:37 UTC
I can reproduce the issue as reported: by copying an image in Spectacle and pasting while Dolphin is open.

The mimetype list is populated with lots of correct-looking mimetypes, but also "application/x-kde-onlyReplaceEmpty" which is the first item in the list, presumably because it starts with "a".

So either it shouldn't be in the list at all, or it shouldn't be selected by default instead of a real image mimetype.
Comment 6 Henning 2023-08-24 13:42:23 UTC
Thanks for the analysis! Yes this makes sense. Does Spectacle save images as PNG by default? Because it doesnt seem to make sense for me that a PNG should be saved as JPEG, what does the conversion? Shouldnt the mimetype that "reaches the clipboard" just be the one spectacle actually uses?
Comment 7 Henning 2023-10-07 23:00:22 UTC
some update: When I edit the screenshot with the Spectacle edit tool (which for some reason got way less features??)

then when saving the format is PNG.

Maybe the screenshot edit tool does something with its output that spectacle alone does not?