Bug 470131 - From Spectacle, Libreoffice, Firefox, ... copied image has replace-mimetype, broken
Summary: From Spectacle, Libreoffice, Firefox, ... copied image has replace-mimetype, ...
Status: RESOLVED DUPLICATE of bug 492006
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (show other bugs)
Version: 5.27.5
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-22 15:56 UTC by Henning
Modified: 2024-08-22 16:17 UTC (History)
4 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-05-22 15:56:23 UTC
SUMMARY
I had a Spectacle image bug that is not due to spectacle but the clipboard it seems.


STEPS TO REPRODUCE
1. Take a screenshot, copy it to clipboard
2. paste it to dolphin
3. try again but set mimetype as "png"

OBSERVED RESULT
The mimetype of the spectacle images is "application/x-kde-onlyReplaceEmpty" and no matter if I just name a screenshot "test" or "test.png" it is not saved. If I manually switch the mimetype over to "PNG" then it is saved.

So the solution is just to make it default to PNG as a workaround, listen to users defaults in the end.

--- Software ---
OS: Fedora Linux 38.20230511.0 (Kinoite)
KDE Plasma: 5.27.4
KDE Frameworks: 5.105.0
Qt: 5.15.9
Kernel: 6.2.14-300.fc38.x86_64
Compositor: wayland
Comment 1 Nate Graham 2023-05-23 18:00:49 UTC
Hmm, I'm not sure I 100% understand what you're doing, and I tried to replicate what I *think* you're doing in an X11 Plasma 6 session, and didn't encounter any problem.

Any chance you could take a screen recording or even a phone video that shows the issue happening? Thanks!
Comment 2 Henning 2023-05-23 22:19:31 UTC
What I am doing:

1. Get an image somewhere. It actually doesnt matter. Examples: taking a spectacle screenshot (set to autocopy to clipboard), copy an image from libreoffice flatpak, copy an image from firefox.

2. Try to paste the image to dolphin.

The image has this named mimetype, which breaks it. Even naming it ".png" doesnt help, its broken completely.

I can make a video but I dont think this is nessecary
Comment 3 Henning 2023-05-23 22:34:16 UTC
https://cloud.uol.de/s/ojt6eTLL4DdxeT2
Comment 4 Nate Graham 2023-05-24 15:15:09 UTC
Thanks for the screen recording. I cannot reproduce the issue with text copied in any app I try.

Are you using any non-default Clipboard settings? Can you attach your ~/.config/klipperrc file?
Comment 5 David Edmundson 2023-05-24 15:38:28 UTC
Klipper is definitely  involved, that's where  application/x-kde-onlyReplaceEmpty comes from

It's not inherently wrong to set that. What's weird is dolphin apparently choosing to take data from a mimetype it doesn't understand when there's multiple available that it does.
Comment 6 Henning 2023-05-24 18:59:36 UTC
Interesting, I had klipper interact in a different area, where Libreoffice crashed cutting images.

I will report this bug to Fedora bugzilla.
Comment 7 TraceyC 2024-08-22 16:14:19 UTC
I replicated this bug in git-master while testing  !391
https://invent.kde.org/graphics/spectacle/-/merge_requests/391

STEPS TO REPRODUCE
- Open Dolphin

Spectacle Settings:
- When launching, do not take screenshot automatically
- After taking screenshot, copy image to clipboard
- Make sure "Save file" is unchecked in settings. With this checked, the feature works normally

1. Take a screenshot using spectacle, use any type of screenshot except Rectangular Region
2. Attempt to paste the image into Dolphin with Ctrl V
3. Enter a name at the prompt (Note: when the content is properly pasted, the name is auto suggested like with saving to file ex Screenshot_date-time.ico)

OBSERVED RESULT
The name field is blank

In Plasma 6.1.4) there is no option to select a type, but if I provide a name, the image is saved
In git-master with MR 391 applied, the user has the option to pick a mime type. The initial one shown is the same as in the original report  "application/x-kde-onlyReplaceEmpty" 
Nothing is pasted to the folder in Dolphin, even with a name provided, as in the original report.

EXPECTED RESULT
The name is pre-populated in keeping with the default name settings in Spectacle's settings
The Data type matches the image format (png, tiff, jpg etc), the user does not need to manually select the type
The image is pasted as a file in the folder in Dolphin
Comment 8 TraceyC 2024-08-22 16:17:59 UTC
Comment from Noah in bug 492005:

> I've determined that Klipper is not actually at fault. It's actually a KIO paste dialog problem that "application/x-kde-onlyReplaceEmpty" comes first. Klipper puts it last in the format list like it should. In bug 491961 I assumed that the paste dialog formats followed the order of the formats list since the image formats were shown in that order, but I suppose it's slightly different. For posterity, the real bug is bug 492006.

Based on that comment, I'm closing this as a duplicate of bug 492006

*** This bug has been marked as a duplicate of bug 492006 ***