[f-spot/rubenv-gsoc-2009] Remove unused code.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot/rubenv-gsoc-2009] Remove unused code.
- Date: Sun, 23 May 2010 12:37:48 +0000 (UTC)
commit 2ba95a21edde56b056d7fea0bf2c4b60f2502eec
Author: Ruben Vermeersch <ruben savanne be>
Date: Sun May 23 14:37:02 2010 +0200
Remove unused code.
src/Imaging/MetadataStore.cs | 1 -
src/Imaging/PixbufUtils.cs | 89 ------------------------------------------
src/Imaging/Tiff.cs | 8 ----
src/Makefile.am | 4 +-
4 files changed, 2 insertions(+), 100 deletions(-)
---
diff --git a/src/Imaging/MetadataStore.cs b/src/Imaging/MetadataStore.cs
index f9dac0f..ed7bcca 100644
--- a/src/Imaging/MetadataStore.cs
+++ b/src/Imaging/MetadataStore.cs
@@ -7,7 +7,6 @@ using FSpot.Utils;
namespace FSpot {
public class Description {
string predicate;
- string description;
string title;
ValueFormat formater;
diff --git a/src/Imaging/PixbufUtils.cs b/src/Imaging/PixbufUtils.cs
index fddf9ec..1f73621 100644
--- a/src/Imaging/PixbufUtils.cs
+++ b/src/Imaging/PixbufUtils.cs
@@ -57,80 +57,6 @@ public class PixbufUtils {
return scale;
}
-
- // FIXME: These should be in GTK#. When my patch is committed, these LoadFrom* methods will
- // go away.
-
- public class AspectLoader {
- Gdk.PixbufLoader loader = new Gdk.PixbufLoader ();
- int max_width;
- int max_height;
- PixbufOrientation orientation;
-
- public AspectLoader (int max_width, int max_height)
- {
- this.max_height = max_height;
- this.max_width = max_width;
- loader.SizePrepared += HandleSizePrepared;
- }
-
- private void HandleSizePrepared (object obj, SizePreparedArgs args)
- {
- switch (orientation) {
- case PixbufOrientation.LeftTop:
- case PixbufOrientation.LeftBottom:
- case PixbufOrientation.RightTop:
- case PixbufOrientation.RightBottom:
- int tmp = max_width;
- max_width = max_height;
- max_height = tmp;
- break;
- default:
- break;
- }
-
- int scale_width = 0;
- int scale_height = 0;
-
- double scale = Fit (args.Width, args.Height, max_width, max_height, true, out scale_width, out scale_height);
-
- if (scale < 1.0)
- loader.SetSize (scale_width, scale_height);
- }
-
- public Pixbuf Load (System.IO.Stream stream, PixbufOrientation orientation)
- {
- int count;
- byte [] data = new byte [8192];
- while (((count = stream.Read (data, 0, data.Length)) > 0) && loader.Write (data, (ulong)count))
- ;
-
- loader.Close ();
- Pixbuf orig = loader.Pixbuf;
- Gdk.Pixbuf rotated = FSpot.Utils.PixbufUtils.TransformOrientation (orig, orientation);
-
- if (orig != rotated) {
- rotated.CopyThumbnailOptionsFrom (orig);
- orig.Dispose ();
- }
- loader.Dispose ();
- return rotated;
- }
-
- public Pixbuf LoadFromFile (string path)
- {
- try {
- orientation = GetOrientation (path);
- using (FileStream fs = File.OpenRead (path)) {
- return Load (fs, orientation);
- }
- } catch (Exception) {
- System.Console.WriteLine ("Error loading photo {0}", path);
- return null;
- }
- }
- }
-
public static Pixbuf ScaleToMaxSize (Pixbuf pixbuf, int width, int height)
{
return ScaleToMaxSize (pixbuf, width, height, true);
@@ -187,21 +113,6 @@ public class PixbufUtils {
#endif
}
- static public Pixbuf LoadAtMaxSize (string path, int max_width, int max_height)
- {
-#if true
- AspectLoader loader = new AspectLoader (max_width, max_height);
- return loader.LoadFromFile (path);
-#else
- int width, height;
- JpegUtils.GetSize (path, out width, out height);
- PixbufUtils.Fit (width, height, max_width, max_height, false, out width, out height);
- Gdk.Pixbuf image = JpegUtils.LoadScaled (path, width, height);
-
- return image;
-#endif
- }
-
static public Pixbuf LoadFromStream (System.IO.Stream input)
{
Gdk.PixbufLoader loader = new Gdk.PixbufLoader ();
diff --git a/src/Imaging/Tiff.cs b/src/Imaging/Tiff.cs
index 507bdad..18a2218 100644
--- a/src/Imaging/Tiff.cs
+++ b/src/Imaging/Tiff.cs
@@ -1259,14 +1259,6 @@ namespace FSpot.Tiff {
return null;
}
- private DirectoryEntry GetEntry (int i)
- {
- if (i < Entries.Count)
- return Entries [i];
- else
- return null;
- }
-
public DirectoryEntry Lookup (uint id)
{
foreach (DirectoryEntry entry in entries)
diff --git a/src/Makefile.am b/src/Makefile.am
index c824f68..f407ea2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -554,12 +554,12 @@ FSpot.Core.dll: $(CORE_CSFILES) FSpot.Utils.dll Cms.dll
FSpot.Imaging.dll.mdb: FSpot.Imaging.dll
FSpot.Imaging.dll: $(IMAGING_CSFILES) FSpot.Utils.dll FSpot.Core.dll
- $(CSC_LIB) -out:$@ $(EXTRAFLAGS) $(UNSAFE) $(IMAGING_CSFILES) $(IMAGING_ASSEMBLIES)
+ $(CSC_LIB) -warnaserror -out:$@ $(EXTRAFLAGS) $(UNSAFE) $(IMAGING_CSFILES) $(IMAGING_ASSEMBLIES)
FSpot.Loaders.dll.mdb: FSpot.Loaders.dll
FSpot.Loaders.dll: $(LOADERS_CSFILES) FSpot.Platform.dll FSpot.Utils.dll FSpot.Imaging.dll FSpot.Core.dll
- $(CSC_LIB) -out:$@ $(EXTRAFLAGS) $(LOADERS_CSFILES) $(LOADERS_ASSEMBLIES)
+ $(CSC_LIB) -warnaserror -out:$@ $(EXTRAFLAGS) $(LOADERS_CSFILES) $(LOADERS_ASSEMBLIES)
FSpot.Query.dll.mdb: FSpot.Query.dll
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]