gabm / Satty

Satty - Modern Screenshot Annotation. A tool inspired by Swappy and Flameshot.
Mozilla Public License 2.0
385 stars 18 forks source link

[Bug] The blur tool doesn't blur the right part of the image if the window's size is changed #83

Closed 00-kat closed 1 month ago

00-kat commented 1 month ago

This is quite a weird bug, so it's best if I demonstrate. Say I have a wizard.jpg open in satty: image And now I blur the wizard's face: image Works fine!

Now, in fullscreen! Edit: changing the window's size also works, you don't have to go into fullscreen. image There's a black box there 😕 The problem is, the size of the image is used to grab the pixels to blur. Let's say I blur some white space: image Obviously, it blurred something. That's not what was at that location though.

There are black squares since there were no pixels at the spot where the blur tool was grabbing the pixels to blur from. These black squares don't actually do anything after you copy/save the file, they just disappear, so in the end they don't end up hiding what you're trying to hide whatsoever.

gabm commented 1 month ago

uff.. another coordinate system bug...good catch!

gabm commented 1 month ago

Note: that was probably a satty bug. Mipmaps are generated during image creation and most likely not re-generated when the image is altered. That is why we see strange things happening, once scale is applied.. I removed mipmapping and the problem is gone

00-kat commented 1 month ago

(running off git)

I was about to say it works in both windowed mode and fullscreen mode, but... image I drew a box around my profile picture with the blur tool and got that. So it seems the bug is still there, since fullscreen mode resizes the image as well (#81)

What I was originally planning to say is that resizing the window breaks it again, and it looks exactly like in the previous screenshot, except it's windowed mode.

(Edit: I should mention that I can't reopen the issue so you'll have to do that)

gabm commented 1 month ago

that is a pretty tough beast :) I'll check wether i can reproduce it

gabm commented 1 month ago

is there some scaling (highdpi) involved?

00-kat commented 1 month ago

is there some scaling (highdpi) involved?

Nope, 1.0x, but I can check on my laptop's screen to see if it's any different there (edit: no difference (1.5x scaling)).

Edit 2: I was able to repro this in a Arch Linux vm running Hyprland.

gabm commented 1 month ago

aaah now I see - the problem is when selecting a region after the window was resized.. .. not resizing the window after selecting..

gabm commented 1 month ago

@00-kat can you confirm its fixed now?

00-kat commented 1 month ago

Can confirm, it's fixed now!