[gthumb] image rotator: make sure the crop area is inside the original image



commit dbbaa727323b95655cde726938103452136d7566
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon May 16 22:36:28 2011 +0200

    image rotator: make sure the crop area is inside the original image

 extensions/file_tools/gth-image-rotator.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/extensions/file_tools/gth-image-rotator.c b/extensions/file_tools/gth-image-rotator.c
index 02cef83..2349b82 100644
--- a/extensions/file_tools/gth-image-rotator.c
+++ b/extensions/file_tools/gth-image-rotator.c
@@ -787,8 +787,8 @@ gth_image_rotator_get_result_high_quality (GthImageRotator *self)
 	result = _cairo_image_surface_copy_subsurface (rotated,
 						       self->priv->crop_region.x,
 						       self->priv->crop_region.y,
-						       self->priv->crop_region.width,
-						       self->priv->crop_region.height);
+						       MIN (self->priv->crop_region.width, cairo_image_surface_get_width (rotated) - self->priv->crop_region.x),
+						       MIN (self->priv->crop_region.height, cairo_image_surface_get_height (rotated) - self->priv->crop_region.y));
 
 	cairo_surface_destroy (rotated);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]