f-spot r4464 - in trunk: extensions/Exporters/FolderExport src/Filters



Author: sdelcroix
Date: Sat Oct  4 11:26:03 2008
New Revision: 4464
URL: http://svn.gnome.org/viewvc/f-spot?rev=4464&view=rev

Log:
use th eusing pattern here and there... should help to avoid leakages

Modified:
   trunk/extensions/Exporters/FolderExport/FolderExport.addin.xml
   trunk/extensions/Exporters/FolderExport/FolderExport.cs
   trunk/src/Filters/OrientationFilter.cs

Modified: trunk/extensions/Exporters/FolderExport/FolderExport.addin.xml
==============================================================================
--- trunk/extensions/Exporters/FolderExport/FolderExport.addin.xml	(original)
+++ trunk/extensions/Exporters/FolderExport/FolderExport.addin.xml	Sat Oct  4 11:26:03 2008
@@ -1,5 +1,5 @@
 <Addin namespace="FSpot"
-	version="0.5.0.0"
+	version="0.5.0.1"
 	name="Folder Export"
 	description="This extension allows you to export your photos to HTML galleries, Original galleries or just to a folder."
 	author="F-Spot team"

Modified: trunk/extensions/Exporters/FolderExport/FolderExport.cs
==============================================================================
--- trunk/extensions/Exporters/FolderExport/FolderExport.cs	(original)
+++ trunk/extensions/Exporters/FolderExport/FolderExport.cs	Sat Oct  4 11:26:03 2008
@@ -1376,8 +1376,9 @@
 			if (icon.Height != 52 || icon.Width != 52) {
 				scaled=icon.ScaleSimple(52,52,Gdk.InterpType.Bilinear);
 			} else
-				scaled=icon;
+				scaled=icon.Copy ();
 			scaled.Save (SubdirPath("tags",TagName(tag)), "png");
+			scaled.Dispose ();
 		}
 
 		public string TagPath (Tag tag)

Modified: trunk/src/Filters/OrientationFilter.cs
==============================================================================
--- trunk/src/Filters/OrientationFilter.cs	(original)
+++ trunk/src/Filters/OrientationFilter.cs	Sat Oct  4 11:26:03 2008
@@ -45,19 +45,19 @@
 					
 					int width, height;
 	
-					jimg = ImageFile.Create (dest) as JpegFile;
-					
-					PixbufUtils.GetSize (dest, out width, out height);
-	
-					jimg.SetOrientation (PixbufOrientation.TopLeft);
-					jimg.SetDimensions (width, height);
-	
-					Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (dest, 160, 120, true);
-					jimg.SetThumbnail (pixbuf);
-					pixbuf.Dispose ();
-	
-					jimg.SaveMetaData (dest);
-					jimg.Dispose ();
+					using (jimg = ImageFile.Create (dest) as JpegFile) {
+						PixbufUtils.GetSize (dest, out width, out height);
+
+						jimg.SetOrientation (PixbufOrientation.TopLeft);
+						jimg.SetDimensions (width, height);
+
+						using (Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (dest, 160, 120, true)) {
+							jimg.SetThumbnail (pixbuf);
+						}
+
+						jimg.SaveMetaData (dest);
+						jimg.Dispose ();
+					}
 				}
 	
 				if (changed)



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