scrot icon indicating copy to clipboard operation
scrot copied to clipboard

[Bug] Scrot uses old screencaptures

Open teapat opened this issue 5 years ago • 8 comments

A few days ago I used scrot to try to display differences of my tmux configs to my better looking half. Just to see an old screencapture I did before, which I deleted already, was taken purely for test purposes.

Since then I could reproduce the bug somewhat consistent by just taking a few screenshots in a row. Just used for i in 1 2 3; do scrot; echo "$i"; sleep 1; done and got a screenshot I did to test scrot after I reinstalled it an hour ago. (Which also is deleted for the same time).

Tested under i3 and bspwm, through different methods and naming the files and setting the overwrite flag.

(Also tested with st, termite, sxhkd and dmenu)

[Currently using Arch 5.5.6* and Xorg 1.20.7-1]

teapat avatar Mar 01 '20 22:03 teapat

2020-03-01-233939_1280x800_scrot On the left the console and what you should see (not including the feh), on the right the scrot taken (which was taken before and deleted).

teapat avatar Mar 01 '20 22:03 teapat

Same problem with any other version of scrot I found so far. Maim works fine.

teapat avatar Mar 02 '20 17:03 teapat

I wasn't able to reproduce :/

keysym avatar Mar 07 '20 20:03 keysym

Was not able to reproduce, either. I suspect this is not a scrot bug, but rather a filesystem issue.

@teapat would you mind to append the following information to your bug report:

  • md5sum *_scrot.png of both: the deleted screenshot and the newly created screenshot containing the "old" image.
  • The inode of both screenshots (ls -li *_scrot.png).
  • What filesystem are you using (sudo blkid)?

dirdi avatar Apr 19 '20 17:04 dirdi

Same Here, somethings scrot take an old screenshot and paste it with the new one

ghost avatar Dec 05 '20 05:12 ghost

Please, for future reports:

  1. Indicate what already said by @dirdi and also: version of scrot, giblib, imlib2
  2. Try save in another format that is not PNG.

I have not seen problems in scrot or giblib but there is a substantial change between the imlib2 version 1.6 and 1.7 in the implementation of image saving, in the report of errors. I am not claiming that imlib2 has a bug, only that it is a possible clue.

Flow when saving:

scrot -> giblib -> imlib2 -> loaders (dlsym) -> (png.so, jpg.so, etc)

Cheers.

daltomi avatar Mar 14 '21 20:03 daltomi

I have the same issues. But I think its not a scrot bug. It seems to be even worse. scrot only shows the result of a problem at another place.

Taking screenshots with scrot shows sometimes old screens. But it is not the output file thats the problem here. The root cause seems to be the point when the screen is captured. I have seen that this also happens when I use other things like jitsi via chromium. I want to share my whole screen, but the guy on the other end can only see an old screenshot of my screen. But after that it also works on the other way: scrot can save a screenshot of the point when I started a web screen sharing via jitsi.

So my idea is: A screen capture is cached(?) somewhere and it pops up as soon as I want to capture a new screen. After that some magic happen.

I am not sure to 100% but I strongly assume that I have seen this old screen captures even after I rebooted my laptop.

Arch Linux
xorg-server 
i3-gapps

x70b1 avatar Aug 11 '21 16:08 x70b1