New guide with unit selection
Submitted by Michael Schumacher
Link to original bug (#770915)
Description
Created attachment 334857 New guide script with unit selection
The attached script started out as a reply to https://www.reddit.com/r/GIMP/comments/519czn/create_guides_using_inches_and_not_pixels/ and made me discover that we lack a useful procedure for getting the list of units (or a nice value+unit widget for Script-Fu).
It allows pretty much the same as the current guides-new script - it is in fact based on it - but takes an additional parameter, a unit ID, and adjust the guide position according to the image resolutions.
The script seems to work within the limitations of the current guide infrastructure, namely that guides can only be placed at pixel positions. I haven't done any thorough testing yet, though.
Things get tricky when dealing with fractions of pixels, right now the script uses round them - the original script behavior seems to truncate.
Attachment 334857, "New guide script with unit selection":
guides-new-unit.scm
Version: git master