[f-spot] fix the tag cropping for rotated images
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] fix the tag cropping for rotated images
- Date: Sat, 11 Jul 2009 19:30:31 +0000 (UTC)
commit fb18b0222cb224d5eff785cbc461bd5ca08662b4
Author: Stephane Delcroix <stephane delcroix org>
Date: Sat Jul 11 21:30:18 2009 +0200
fix the tag cropping for rotated images
src/UI.Dialog/EditTagIconDialog.cs | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/UI.Dialog/EditTagIconDialog.cs b/src/UI.Dialog/EditTagIconDialog.cs
index 0390172..b8184b7 100644
--- a/src/UI.Dialog/EditTagIconDialog.cs
+++ b/src/UI.Dialog/EditTagIconDialog.cs
@@ -186,16 +186,18 @@ namespace FSpot.UI.Dialog
int width = image_view.Selection.Width;
int height = image_view.Selection.Height;
-// if (width > 0 && height > 0)
-// icon_view.Selection.Clear ();
-
if (image_view.Pixbuf != null) {
- if (width > 0 && height > 0) {
- using (var tmp = new Gdk.Pixbuf (image_view.Pixbuf, x, y, width, height)) {
- PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (tmp);
+ if (image_view.Selection != Gdk.Rectangle.Zero) {
+ using (var tmp = new Gdk.Pixbuf (image_view.Pixbuf, x, y, width, height)) {
+ Gdk.Pixbuf transformed = FSpot.Utils.PixbufUtils.TransformOrientation (tmp, image_view.PixbufOrientation);
+ PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (transformed);
+ if (transformed != tmp)
+ transformed.Dispose ();
}
} else {
- PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (image_view.Pixbuf);
+ Gdk.Pixbuf transformed = FSpot.Utils.PixbufUtils.TransformOrientation (image_view.Pixbuf, image_view.PixbufOrientation);
+ PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (transformed);
+ transformed.Dispose ();
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]