Review Request 128952: Optionally Downscale Images on HiDPI

Jason A. Donenfeld jason at zx2c4.com
Tue Sep 20 17:36:46 UTC 2016



> On Sept. 20, 2016, 10:54 a.m., Boudhayan Gupta wrote:
> > src/ExportManager.cpp, line 89
> > <https://git.reviewboard.kde.org/r/128952/diff/1/?file=477155#file477155line89>
> >
> >     I'm a little hesitant about hardcoding a 96.0 dpi value. There's a scale factor somewhere (QScreen::devicePixelRatio() I believe) - just divide?

devicePixelRatio() isn't what you want. This is essentially just the value of `QT_SCREEN_SCALE_FACTORS`, which is for many HiDPI users "1". In otherwords, this represents the scaling ratio for things like cell padding and window size defaults. The real thing we want is to know how things are in terms of the X server's DPI, because this is what influences everything else. And for that we must use the logical DPI. The 96 value isn't some horrible hardcoded value. Rather, the "x" notation of scaling is defined in terms of that. It would be a mistake to scale the image by a precise amount, because HiDPI is supposed to match classic screen sizes by whole ratios. In other words, the scaled down image will always be coherent as resolution/2 or resolution/3 or resolution/4.

So, I think this is the right approach here.


- Jason A.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128952/#review99310
-----------------------------------------------------------


On Sept. 20, 2016, 2:27 a.m., Jason A. Donenfeld wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128952/
> -----------------------------------------------------------
> 
> (Updated Sept. 20, 2016, 2:27 a.m.)
> 
> 
> Review request for KDE Graphics and Boudhayan Gupta.
> 
> 
> Repository: spectacle
> 
> 
> Description
> -------
> 
> Some people use "retina displays" or HiDPI displays. Taking screenshots
> and then posting them to the Internet is especially annoying with these
> displays, because the images are twice as big in the web browser. For
> those who primarily use Spectacle for taking web screenshots, this
> commit adds a new option (default: off) to downscale HiDPI images to the
> ordinary "1x" size so that they can be used for sharing.
> 
> In the HiDPI mode, things are usually discussed in terms of "x", where
> each "x" is actually 96 DPI. This automatic feature simply sees which
> "x" is closest by dividing the configured DPI by 96 and rounding.
> 
> Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
> 
> 
> Diffs
> -----
> 
>   src/ExportManager.cpp 763b1f32ad42bca1b3f1d6bcb0f7f908a54b6641 
>   src/Gui/SettingsDialog/GeneralOptionsPage.h 343ce037b7d1da9c9c12f0fe4eb44bf4a132d4fe 
>   src/Gui/SettingsDialog/GeneralOptionsPage.cpp 1ffddd9c733d3b6f3897949ab67883886f651a69 
>   src/SpectacleConfig.h 5a91f702777cde05f9608d6157d533f2e6e21347 
>   src/SpectacleConfig.cpp b812b00246421fd784d7b4646978c39fb50dfbd4 
> 
> Diff: https://git.reviewboard.kde.org/r/128952/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jason A. Donenfeld
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-graphics-devel/attachments/20160920/5b79511c/attachment.html>


More information about the Kde-graphics-devel mailing list