Bug 362450 - Capturing small rectangular regions fails
Summary: Capturing small rectangular regions fails
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 365741 365782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-04-28 23:14 UTC by Jan Wiele
Modified: 2016-10-13 01:00 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 16.12
Sentry Crash Report:


Attachments
Broken preview of small rectangular area. (246.08 KB, image/png)
2016-07-22 21:38 UTC, Jan Wiele
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Wiele 2016-04-28 23:14:53 UTC
Hi, 
I am using Spectacle 16.0.4.0. When I try to capture a small rectangular region (50x50 pixel) I get an empty result preview, sometimes it shows a distorted picture of my cursor. Larger regions work just fine. In the case if an empty preview, saving the screenshot works. In the second case, saving will create a 0 Byte file.

Im running the proprietary Nvidia drivers 364.19-1.

Reproducible: Always

Steps to Reproduce:
1. Capture a small rectangular region


Actual Results:  
None or broken preview

Expected Results:  
Preview showing the captured area
Comment 1 Jan Wiele 2016-04-28 23:25:07 UTC
To receive the distorted cursor: Enable to capture the cursor, take a new screenshot, select the region to capture, move the cursor into this area, press enter.

Regarding the broken file: I'm not sure where the 0 Byte file in my test files comes from, but saving a file with a distorted cursor seems to work fine. I'm assuming saving works all the time
Comment 2 Niklas Larsson 2016-05-02 12:13:32 UTC
I have similary issue, full screen works nicely, but area is not. Dpesn't matter size of area.

But the picture is visible if I drag it from the preview area, but exporting to gimp shows an empty picture with the size of the area.

Manjaro - spectacle version 16.04.0, KDE framwork 5.21.0, QT 5.6.0, xcb
Comment 3 jlj.babydragon 2016-05-16 02:17:43 UTC
I have the same issue too, "Rectangular Region" mode capture nothing.


KDE framwork 5.21.0
Qt 5.6.0
xcb
Comment 4 Niklas Larsson 2016-05-16 06:11:23 UTC
Hi,

Works again with 16.04.1.
Comment 5 Jan Wiele 2016-07-22 21:38:50 UTC
Created attachment 100251 [details]
Broken preview of small rectangular area.

The preview for a small rectangular area is still broken for me with 16.04.3.

I've attached a screenshot.
Comment 6 Peter Wu 2016-10-06 23:03:15 UTC
Can confirm this issue with Plasma 5.8 on Arch Linux (though the problem is older). Using xf86-video-modesetting (xorg-server 1.18.4-1), mesa 12.0.3-2, Linux v4.8 with i915, i7-6700HQ.

Anything with a width smaller than 403 (e.g. 402x21) results in an empty preview (no idea if smaller heights cause issues, I could not make the height smaller). Invoking this->pixmap()->save("1.png") in KSImageWidget::setScreenshot does show the selected area though.

Previously reported as bug 359184, another duplicate is bug 365741.
Comment 7 Peter Wu 2016-10-07 00:58:49 UTC
9x340 is also visible, 9x339 (and some smaller) are not. What is special about 402x339? Looks like it is size of the preview area.

mPixmap.load("1.png") with the same pixmap that failed to load somehow DOES show up in the preview. How does this work...? Strange Qt bug. (qt5-base 5.7.0-3)
Comment 8 Peter Wu 2016-10-11 21:04:10 UTC
Git commit 45751d7d8bc2a24abf75644d010018875c17daef by Peter Wu.
Committed on 11/10/2016 at 21:01.
Pushed by peterwu into branch 'master'.

Fix broken previews for small selection

The use of QGraphicsDropShadowEffect in KSImageWidget enables opacity.
When the previous format is RGB32, it can be converted directly to
ARGB32 with no data changes (assuming that the pixel data really has the
format 0xffRRGGBB).

Apparently the data returned by XCB has varying values (including zero)
for the alpha channel which violates the RGB32 format and results in
fully transparant pictures. Explicitly set the bits to fix this.

REVIEW: 129135
FIXED-IN: 16.12

M  +8    -0    src/PlatformBackends/X11ImageGrabber.cpp

http://commits.kde.org/spectacle/45751d7d8bc2a24abf75644d010018875c17daef
Comment 9 Peter Wu 2016-10-11 21:07:10 UTC
*** Bug 365741 has been marked as a duplicate of this bug. ***
Comment 10 Peter Wu 2016-10-13 01:00:36 UTC
*** Bug 365782 has been marked as a duplicate of this bug. ***