Commit caaf65cc authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

Ignore guides at or beyond image bounds, since those aren't valid slicing

2005-02-19  Manish Singh  <yosh@gimp.org>

        * plug-ins/pygimp/plug-ins/py-slice.py: Ignore guides at or beyond
        image bounds, since those aren't valid slicing bounds. Fixes bug
        #167843.
parent 17e7e13e
2005-02-19 Manish Singh <yosh@gimp.org>
* plug-ins/pygimp/plug-ins/py-slice.py: Ignore guides at or beyond
image bounds, since those aren't valid slicing bounds. Fixes bug
#167843.
2005-02-20 Sven Neumann <sven@gimp.org>
* app/dialogs/user-install-dialog.c: migrate gimp-2.2 settings if
......
......@@ -89,6 +89,8 @@ def slice(image, image_path, image_basename, image_extension,
filename = os.path.join(image_path, src)
temp_image = image.duplicate()
temp_image.disable_undo()
temp_image.crop(right - left, bottom - top, left, top)
pdb.gimp_file_save(temp_image, temp_image.active_layer, filename, filename)
......@@ -116,10 +118,15 @@ def get_guides(image):
for guide in GuideIter(image):
orientation = image.get_guide_orientation(guide)
if orientation == ORIENTATION_VERTICAL:
vguides.append((image.get_guide_position(guide), guide))
elif orientation == ORIENTATION_HORIZONTAL:
hguides.append((image.get_guide_position(guide), guide))
guide_position = image.get_guide_position(guide)
if guide_position > 0:
if orientation == ORIENTATION_VERTICAL:
if guide_position < image.width:
vguides.append((guide_position, guide))
elif orientation == ORIENTATION_HORIZONTAL:
if guide_position < image.height:
hguides.append((guide_position, guide))
def position_sort(x, y):
return cmp(x[0], y[0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment