-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Region selection in "import" command produce corrupted graphics and output (Unexpected lines). #1460
Comments
The ImageMagick code that supports "rubber banding" has worked well and remained unchanged for nearly 20 years now. Recently we have on occasion seen the behavior you reported suggesting a change and / or bug in the Windows manager or in the X11 protocol. We'll investigate but it will likely take some time to track the source of this problem particularly since we currently cannot reproduce the problem. |
@urban-warrior Do you mind pointing me to the source code for the drawing? I might try and solve this myself, since I can replicate it readily. |
Take a look @ MagickCore/XSelectWindow(). XSelectWindow() allows a user to select a window using the mouse. If the mouse moves, a cropping rectangle is drawn and the extents of the rectangle is returned. |
@urban-warrior It seems the unexpected results are resulted from applications redrawing the regions where the selection happens, thus rubber banding fails. Grabbing the X server before performing the selection solves the problem. I tried it in multiple situations and it worked fine. Is there an objection to this approach? |
We grab the pointer but your suggesting we grab the server as well. Easy enough to do. Can you create a pull request with the patch or I suspect its just a few lines, you can post it here. |
@urban-warrior The patch is indeed simple. However, I am not sure how to create diffs. So I just created a pull request #1563. I also added more details to explain why the server should be grabbed. One question though, what is the significance of |
Prerequisites
Description
When taking a screenshot using the command
import test.png
, the rectangle lines used to visualize the selected region leave trails and artifacts, those lines are preserved and are visible in the final image. This gif illustrates the problem:Steps to Reproduce
Execute:
import test.png
System Configuration
This question on SuperUser seem to be related.
The text was updated successfully, but these errors were encountered: