After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758352 - cropping is broken on HiDpi screens?
cropping is broken on HiDpi screens?
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.19.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-19 17:01 UTC by Andreas Nilsson
Modified: 2015-12-04 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (687.39 KB, image/jpeg)
2015-11-19 17:03 UTC, Andreas Nilsson
  Details
gegl-gtk-view, gegl-gtk-view-helper, tool-crop: Rename scale to zoom (19.35 KB, patch)
2015-12-03 12:09 UTC, Debarshi Ray
committed Details | Review
gegl-gtk-view-helper: Clean up (911 bytes, patch)
2015-12-03 12:10 UTC, Debarshi Ray
committed Details | Review
gegl-gtk-view-helper, tool-crop: Fix cropping on HiDpi (7.82 KB, patch)
2015-12-03 12:11 UTC, Debarshi Ray
none Details | Review
screenshot (683.23 KB, image/jpeg)
2015-12-03 13:23 UTC, Andreas Nilsson
  Details
gegl-gtk-view-helper, tool-crop: Fix cropping on HiDpi (6.50 KB, patch)
2015-12-04 10:53 UTC, Debarshi Ray
committed Details | Review

Description Andreas Nilsson 2015-11-19 17:01:22 UTC
Cropping works really weird for me, and I first thought it was a wayland problem, but it appears under X as well.
The initial area is way to big, and there is an area to the left where the cropping box refuses to go, so maybe it miscalculates somehow?
Might be the hidpi-thing that does it? Not sure.
Comment 1 Andreas Nilsson 2015-11-19 17:03:03 UTC
Created attachment 315905 [details]
screenshot
Comment 2 Debarshi Ray 2015-11-19 18:21:23 UTC
This is known. :) It's due to HiDpi.

I wrote the code on a LoDpi system and didn't want to complicate things by involving HiDpi-correctness. The bug arises from places where cairo drawing meets raw image pixels. We need to sprinkle some divisions and multiplications by the scale factor.
Comment 3 Debarshi Ray 2015-12-03 12:09:49 UTC
Created attachment 316715 [details] [review]
gegl-gtk-view, gegl-gtk-view-helper, tool-crop: Rename scale to zoom
Comment 4 Debarshi Ray 2015-12-03 12:10:30 UTC
Created attachment 316716 [details] [review]
gegl-gtk-view-helper: Clean up
Comment 5 Debarshi Ray 2015-12-03 12:11:02 UTC
Created attachment 316717 [details] [review]
gegl-gtk-view-helper, tool-crop: Fix cropping on HiDpi
Comment 6 Andreas Nilsson 2015-12-03 13:23:54 UTC
Created attachment 316719 [details]
screenshot

Seems to work fine in general.
Is original size supposed to only be in the middle of the whole image though?
Comment 7 Andreas Nilsson 2015-12-03 13:29:48 UTC
Just want to make sure that's the intended behaviour, and not something it miscalculates.
Comment 8 Debarshi Ray 2015-12-03 14:30:07 UTC
(In reply to Andreas Nilsson from comment #6)
> Seems to work fine in general.
> Is original size supposed to only be in the middle of the whole image though?

When you select the tool for the first time, it is supposed to place the crop area in the middle. If you resize/move it, then move to a different tool, and then come back to 'crop', then the area should be marked as you had left it. It shouldn't just go back to the centre.

It seems to work like that for me.

There is a bug (both in Lo and HiDpi) where if you reset the tool and re-open it, then the crop area is not in the middle, but spans the entire image.
Comment 9 Andreas Nilsson 2015-12-03 15:43:01 UTC
Ah, OK. Just wanted to make sure it's consistent across lo- and hidpi.
Comment 10 Debarshi Ray 2015-12-04 10:53:21 UTC
Created attachment 316762 [details] [review]
gegl-gtk-view-helper, tool-crop: Fix cropping on HiDpi

We don't need to multiply the dimensions of the crop tool's surface by the scale factor. gdk_window_create_similar_surface takes care of it.