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 170760 - Setting guides to arbitrary sub-pixel positions
Setting guides to arbitrary sub-pixel positions
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: General
2.2.x
Other All
: Low enhancement
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks: 775068
 
 
Reported: 2005-03-18 06:12 UTC by Matthew Prasinov
Modified: 2018-05-24 11:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
image of wrong guides (6.25 KB, image/gif)
2005-03-23 03:17 UTC, Matthew Prasinov
Details

Description Matthew Prasinov 2005-03-18 06:12:24 UTC
The ability to select a guide and actually type in its desired position would 
be much appreciated. Also, the guides seem a little misaligned when you zoom in 
real close and look at the rulers, the readout at the bottom says its at 170.0 
px but when you look at the ruler it seems like its actually at 170.17, 
slightly off.
Comment 1 Michael Schumacher 2005-03-18 14:14:39 UTC
I've checked this with 25600% zoom and the guides are not the slightest bit
misaligned. An offset of 0.17 would be really noticeable at this scale. I've
also seen no offset at any level in between.

There is a menu entry in the Image menu that allows guides to be added at
precise (pixel) locations, or at a certain percentage of the image width.

What's missing is the ability to move the "active guide" - there is no PDB
function for getting this guide (I don't know if such a guide exists at all).
Maybe the summary of this request should be adjusted to refelct what really has
to be done.

Comment 2 Michael Natterer 2005-03-18 17:32:33 UTC
There is no active guide. That's only a visual thing on the display
done by the move tool.
Comment 3 weskaggs 2005-03-18 18:22:39 UTC
I'm going to resolve this as NOTABUG on the grounds that (1) the guides are not
actually misaligned, and (2) you can get a guide to a specified location by
dragging the existing one off the image and using the menu entry described in
comment #1 to generate a new one.  It may be worth noting, though, that if the
alignment tool attached to bug #147437 makes it into GIMP, it will eventually
have the ability to align existing guides with various things using
user-specified offsets.

If in spite of comment #1 you still think the guides are not being drawn in the
right place, please provide a screenshot that shows it, and feel free to reopen
this bug report.
Comment 4 Matthew Prasinov 2005-03-23 03:17:15 UTC
Created attachment 39110 [details]
image of wrong guides
Comment 5 Matthew Prasinov 2005-03-23 03:18:55 UTC
Comment on attachment 39110 [details]
image of wrong guides

the ruler and guides seem a little wrong zoomed in at 25600%, see the attatched
pic, the readout at the bottom says its 25.0 and its clearly not. Also, the
guides sometimes do this annoying thing where it wont allow me to move it to
say 50.0, but will keep jumping to either 49.9 or 50.1 . You should be able to
move guides smaller distances than 0.1....
Comment 6 weskaggs 2005-03-23 16:31:59 UTC
Guides are actually located between pixels rather than centered on pixels, so
when a guide says 25.0, it is actually located at 25.5.  This is assuming that
the units are pixels -- if your units are something else, please say so. 
Anyway, I agree that this is a bit confusing, and as another bug report points
out, for some purposes (mainly paint tools) it is not what you want.  For
selection tools, it is exactly what you want.  

Could you explain why you want to move guides fraction-of-a-pixel distances,
given that any operation you do acts on whole pixels?  I can imagine reasons,
but I would like to understand your reasons.
Comment 7 Matthew Prasinov 2005-03-24 01:41:47 UTC
I am working in mm, sorry about that, I meant mm not px. I want it perfect 
cause Im going to be stting up a label and the guy Im doing it for wants 
perfection.
Comment 8 Michael Schumacher 2005-03-24 09:55:13 UTC
Ok, so this is an enhacement request for being able to set guides at aribtrary
positions depending on the currently selected unit.
Comment 9 Michael Natterer 2005-03-24 11:24:12 UTC
I don't see how this relates in any way to the unit. This is a request
to place guides at sub-pixel positions.
Comment 10 Sven Neumann 2005-03-24 21:20:43 UTC
You cannot set anything in GIMP to sub-pixel positions, so what's the point of
being able to place guides there?
Comment 11 weskaggs 2005-03-25 00:05:19 UTC
Path anchors can have sub-pixel positions, and so can paint application points.
Comment 12 Matthew Prasinov 2005-03-29 02:43:26 UTC
OK, the thing I am really concerned with is the fact that when I set a guide 
at 100.0 pixels, mmm, whatever, when I zoom in and look, the guide is 
obviously not at exactly 100.0 mm px etc. I dont really want to set guides at 
100.5, but when I set it at 100.0, it should be exatly 100.0, no matter how 
close I zoom in. And when I am moving a guide, it should not skip values, like 
I said, annoyingly not allowing me to set it at 100.0, but only 99.9 or 100.1, 
which is useless.
Comment 13 Michael Natterer 2005-03-29 10:35:51 UTC
I cannot reproduce this. No matter how far I zoom in, the guides are always
between pixels. Real world units are a different issue. Matthew, do you
really see guides which at not at exact *pixel* positions?
Comment 14 Michael Schumacher 2005-03-29 11:03:13 UTC
The problem is that the guides are not at exact mm positions. That's why I
changed the summary...

If guides could be assigned arbitrary unit, e.g. "20 mm", GIMP could always
choose the closest pixel representation. It would have to communicate that this
is not the exact location, though. However, the higher the ppi value, the more
accurate it could be.
Comment 15 Michael Natterer 2005-03-29 17:59:02 UTC
I was referring to comment #12. The reporter makes no difference between
pixels and other units. Just wanted to be sure.
Comment 16 Joao S. O. Bueno 2005-03-29 18:18:07 UTC
Anyway, it seems a matter of doing 
    26  -  gint                 position; 
    26  +  gdouble              position; 
 
in app/core/gimpimage-guides.h (and changing XCF loading code to deal 
with this). 
 
I've been trhoug the guides code lately - I could test this, but can't 
generate a patch from here - all the files that touch guides are modified in 
my tree. 
Comment 17 weskaggs 2005-03-29 20:36:50 UTC
The main question is what happens to selection tools (i.e., rect select), which
were coded with the assumption that guides would be located at
half-integer-pixel locations.
Comment 18 Michael Schumacher 2005-03-29 20:47:46 UTC
And we would need some kind of guide snapping - it is useful to snap to whole or
half (or other specific fractions of) the unit. Different bug for this, though.
Comment 19 Michael Natterer 2005-03-30 08:59:51 UTC
Comment #17: All code asumes that guides are in between pixels, not at
half-integer positions.

In case there is any confusion: the pixel located at (0,0) extents
from [0.0..1.0[ in both dimensions and it's half-way position is
at (0.5,0.5)
Comment 20 Matthew Prasinov 2005-03-31 01:49:33 UTC
I set the document units to mm. Just look at the attatchment i posted earlier. 
The readout says that the guide is at 25.0 mm. that doesnt look like 25.0 mm 
to me. Is it really that hard to get the real world measurements and the pixel 
measurements working in tandom?
Comment 21 Sven Neumann 2005-03-31 08:28:26 UTC
Since it is completely trivial, you will certainly send us a patch that fixes it.
Comment 22 Michael Schumacher 2005-03-31 13:10:40 UTC
There are two ways to "fix" this now:

- make the value in the staus bar more precise (24.0314159 mm)
- implement sub-pixel or real world unit guides as described
Comment 23 GNOME Infrastructure Team 2018-05-24 11:29:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/138.