-
-
Notifications
You must be signed in to change notification settings - Fork 198
ksnip -e destroys annotated image on save #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
And now... I found a workaround. The problem is Wayland. Or rather, the problem is that something goes strangely wrong if I run ksnip in my environment, while allowing Qt to auto-adapt as it does at this time. I had this weird thought in my mind, that the factor of 2 by which the images are mistreated sounded familiar - from one point only: it's the scale factor I'm using for my 4k screens. So I ran ksnip like this:
... and voila, it's all good. Suddenly the annotated saved file maintains the original resolution, and it is complete and not just the top-left corner. Magic. I'll close this issue and apologize for the hassle - I hope the workaround is going to help somebody, but I suspect that a fix is out of scope for ksnip. |
hmm, could it be that you're facing this issue that should be fixed in latest? #439 |
@DamirPorobic Yes and no, I guess. I suspect that my issue is related to running on a scaled Wayland. The corner of the image that is being persisted is most definitely the top left one though, every time. Odd discrepancy between my issue and #439, but there it is. Of course my workflow also includes using (I tried to take a screenshot btw, but as long as I'm running natively on Wayland, it does not work - I use Sway and I suspect that ksnip does not support its screenshot protocol.) |
@DamirPorobic My apologies - I didn't mean to ignore your suggestion that v1.8.0 might fix the problem. I just installed that version using the ksnip-git AUR package. Mixed news:
|
Hey Oli, sorry for the late replies, I usually reply within a day. I'm in the middle of a move to a new flat and need to renovate that thing so I don't get to much PC time at the moment :) If I remember correctly, the user that requested Generic Wayland Portal Screenshots used also Sway and for him (and other Sway Users) I have implemented a Setting that prevents this upscaling that you see, it's under the Image Grabber Settings and can only be enabled for Wayand, see here for more details: #243. Regarding the taking Screenshots via DBus, it's the way thinks are done under Wayland. Wayland is more secure then X11 and doesn't allow accessing what you want, you need to request stuff via DBus calls and the DE honors your request or not. So far Gnome and KDE Plasma had own implementations for Wayland Screenshots that were quit different but both relied on DBus calls and ksnip (like other Screenshot tools) supported both ways. Now every DE is implementing the XDG Screenshot Portal for taking screenshots, which is a generic way but also relies on DBus calls but also involves an additional confirmation window (or not, like in the case of Sway). Ksnip adds XDG Portal support with version |
Hi Damir, Moving must be more stressful than usual at this time, I don't envy you!
I didn't read the entire long issue, I'm afraid. However, I'm confused. First, that issue seems to pertain to the actual "grabbing" functionality, as does the setting you mention. I'm not doing any grabbing, I'm just editing. So is it news to you that the problem is actually just one of file persistence, not related to grabbing at all? Or is this a completely different problem after all? Additionally, I'm not sure which setting you are referring to. The thread #243 refers to a "factor" multiple times, but I don't see any setting of a "factor" anywhere on the Image Grabber settings page. I see two items called "force generic wayland screenshot" and "scale generic wayland screenshot". They are both unchecked. I tried running ksnip with and without the "anti-wayland" environment variables and nothing changes about the settings on that page.
I'm not going to pretend to be an expert, but I believe this is only partially true. I was specifically referring to this issue from the Flameshot repo, where I found a comment indicating that the xdg-desktop-portal approach may be too high-level for a screenshot tool, since it may involve a DE-specific dialog popping up. In my environment, I can't see the xdg-desktop-portal based functionality in action, so I can't judge whether this is a big problem. My second reason to say that the statement is only partially true is that I'm now using grim (in combination with slurp), and it takes screenshots very nicely on Sway. I understand it uses a protocol called wlr-screencopy, which seems to be implemented in wlroots and therefore available in all wlroots-based compositors. |
I'm not entirely sure what the cause of this issue is, so I'll write down exactly what I'm doing.
I'm trying to use ksnip as an annotation tool on my wayland machine. I'm taking the original screenshot with grim. Here's one I took just now:
Now I call
ksnip -e <myfile.png>
(I always save the files in PNG format). ksnip comes up and displays the screenshot correctly. Here's what that looks like:I annotate the image using the ksnip tools:
Eventually I save the file. In the workflow I'm trying to establish, I would only click the Save button to save in place, but for illustration purposes I'll Save As a separate file this time. I tested this, it does not make a difference to the problem I'm describing.
Now here's the snag: for some reason my saved file looks like this:
Basically it appears that only the top left corner of the image has been saved. Very strange. What's also very strange is the size of the two files, and the output of
identify
. (20201117-170320.png
is the original file created bygrim
,annotatedresult.png
is the file saved by ksnip.)As you can see, the annotated image is a somewhat smaller file than then original one. At the same time it has four times as many pixels according to
identify
.I don't know if there's anything else to be found in the information that
identify
can provide. Just in case I have put the complete output ofidentify -verbose
to the side, here is that for the original image (20200117-170320.png
) and here is that forannotatedresult.png
. I notice that the initial blocks of image details are quite different, including the geometry information - of course this does not explain anything by itself.The text was updated successfully, but these errors were encountered: