[f-spot/rubenv-gsoc-2009: 47/86] Fix the orientation of thumbnails.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot/rubenv-gsoc-2009: 47/86] Fix the orientation of thumbnails.
- Date: Sun, 23 May 2010 12:35:54 +0000 (UTC)
commit 6bfaa26a8fede9c40e64a728dd8c2d9736eebcb7
Author: Ruben Vermeersch <ruben savanne be>
Date: Fri Jul 31 15:17:16 2009 +0200
Fix the orientation of thumbnails.
And try something for the memory growing.
src/Loaders/GdkImageLoader.cs | 8 ++++++--
src/Loaders/LibrawImageLoader.cs | 11 +++++++++--
src/Widgets/IconViewCache.cs | 5 +----
3 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/src/Loaders/GdkImageLoader.cs b/src/Loaders/GdkImageLoader.cs
index 7110a8f..2caa467 100644
--- a/src/Loaders/GdkImageLoader.cs
+++ b/src/Loaders/GdkImageLoader.cs
@@ -183,8 +183,12 @@ namespace FSpot.Loaders {
if (!ThumbnailFactory.ThumbnailExists (uri)) {
if (ItemsCompleted.Contains (ImageLoaderItem.Large)) {
if (Pixbuf != null)
- using (Pixbuf scaled = PixbufUtils.ScaleToMaxSize (Pixbuf, 256, 256, false))
- ThumbnailFactory.SaveThumbnail (scaled, uri);
+ using (Pixbuf scaled = PixbufUtils.ScaleToMaxSize (Pixbuf, 256, 256, false)) {
+ Pixbuf rotated = FSpot.Utils.PixbufUtils.TransformOrientation (scaled, LargeOrientation);
+ ThumbnailFactory.SaveThumbnail (rotated, uri);
+ if (rotated != scaled)
+ rotated.Dispose ();
+ }
} else {
ItemsRequested |= ImageLoaderItem.Large;
return;
diff --git a/src/Loaders/LibrawImageLoader.cs b/src/Loaders/LibrawImageLoader.cs
index e6c0b05..7d23064 100644
--- a/src/Loaders/LibrawImageLoader.cs
+++ b/src/Loaders/LibrawImageLoader.cs
@@ -79,6 +79,8 @@ namespace FSpot.Loaders {
if (is_disposed)
return ImageLoaderItem.None;
+ Log.Debug ("Loading {0} from {1}", items, uri);
+
ItemsRequested |= items;
StartLoading ();
@@ -103,6 +105,7 @@ namespace FSpot.Loaders {
large.Dispose ();
if (full != null)
full.Dispose ();
+ System.GC.Collect ();
}
#endregion
@@ -161,8 +164,12 @@ namespace FSpot.Loaders {
if (!ThumbnailFactory.ThumbnailExists (uri)) {
if (ItemsCompleted.Contains (ImageLoaderItem.Large)) {
if (large != null)
- using (Pixbuf scaled = PixbufUtils.ScaleToMaxSize (large, 256, 256, false))
- ThumbnailFactory.SaveThumbnail (scaled, uri);
+ using (Pixbuf scaled = PixbufUtils.ScaleToMaxSize (large, 256, 256, false)) {
+ Pixbuf rotated = FSpot.Utils.PixbufUtils.TransformOrientation (scaled, LargeOrientation);
+ ThumbnailFactory.SaveThumbnail (rotated, uri);
+ if (rotated != scaled)
+ rotated.Dispose ();
+ }
} else {
ItemsRequested |= ImageLoaderItem.Large;
return;
diff --git a/src/Widgets/IconViewCache.cs b/src/Widgets/IconViewCache.cs
index a4bd599..667964f 100644
--- a/src/Widgets/IconViewCache.cs
+++ b/src/Widgets/IconViewCache.cs
@@ -189,10 +189,7 @@ namespace FSpot.Widgets {
try {
using (IImageLoader loader = ImageLoader.Create (entry.Uri)) {
loader.Load (ImageLoaderItem.Thumbnail);
- Pixbuf thumb = loader.Thumbnail;
- loaded = FSpot.Utils.PixbufUtils.TransformOrientation (thumb, loader.ThumbnailOrientation);
- if (loaded != thumb && thumb != null)
- thumb.Dispose ();
+ loaded = loader.Thumbnail;
}
this.Update (entry, loaded);
} catch (GLib.GException){
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]