summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-03-16 14:18:13 +0000
committerAlexander Larsson <alexl@src.gnome.org>2009-03-16 14:18:13 +0000
commit8bb6faf391ca16f077959a306c2947314dcbb0ef (patch)
treeab650659b9ecbfa05e2f5e4d0621de07fb445242
parente2a96cc5f75ce13aa5b490fa25e554bcdb4326f5 (diff)
downloadnautilus-8bb6faf391ca16f077959a306c2947314dcbb0ef.tar.gz
Bug 523883 – Thumbnails for 200% zoom are regenerated each time a folder
2009-03-16 Alexander Larsson <alexl@redhat.com> Bug 523883 – Thumbnails for 200% zoom are regenerated each time a folder is opened. * libnautilus-private/nautilus-file.c: (nautilus_file_get_icon): allow scaling up thumbnails, use the scaled up thumnail for up to 25% size increase. * src/file-manager/fm-icon-container.c: (fm_icon_container_get_icon_images): Force thumbnail size for compact view to avoid loading at wrong size and then rescaling svn path=/trunk/; revision=15122
-rw-r--r--ChangeLog14
-rw-r--r--libnautilus-private/nautilus-file.c26
-rw-r--r--src/file-manager/fm-icon-container.c3
3 files changed, 25 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ca9eb07a..12a92e852 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2009-03-16 Alexander Larsson <alexl@redhat.com>
+ Bug 523883 – Thumbnails for 200% zoom are regenerated each time a folder is opened.
+
+ * libnautilus-private/nautilus-file.c:
+ (nautilus_file_get_icon):
+ allow scaling up thumbnails, use the scaled up thumnail
+ for up to 25% size increase.
+
+ * src/file-manager/fm-icon-container.c:
+ (fm_icon_container_get_icon_images):
+ Force thumbnail size for compact view to avoid loading at wrong size
+ and then rescaling
+
+2009-03-16 Alexander Larsson <alexl@redhat.com>
+
* configure.in:
Post release version bump
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index c1ed000ed..4c3816bfd 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3579,27 +3579,17 @@ nautilus_file_get_icon (NautilusFile *file,
scale = (double)modified_size / s;
- if (scale > 0.99) {
- /* never scale any thumbnails up */
- scaled_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
- gdk_pixbuf_get_has_alpha (raw_pixbuf),
- gdk_pixbuf_get_bits_per_sample (raw_pixbuf),
- w * scale, h * scale);
- gdk_pixbuf_fill (scaled_pixbuf, 0xffffff00);
- gdk_pixbuf_copy_area (raw_pixbuf,
- 0, 0, w, h,
- scaled_pixbuf,
- (gdk_pixbuf_get_width (scaled_pixbuf) - w) / 2,
- (gdk_pixbuf_get_height (scaled_pixbuf) - h) / 2);
- } else {
- scaled_pixbuf = gdk_pixbuf_scale_simple (raw_pixbuf,
- w * scale, h * scale,
- GDK_INTERP_BILINEAR);
- }
+ scaled_pixbuf = gdk_pixbuf_scale_simple (raw_pixbuf,
+ w * scale, h * scale,
+ GDK_INTERP_BILINEAR);
nautilus_thumbnail_frame_image (&scaled_pixbuf);
g_object_unref (raw_pixbuf);
- if (modified_size > 128 &&
+ /* Don't scale up if more than 25%, then read the original
+ image instead. We don't want to compare to exactly 100%,
+ since the zoom level 150% gives thumbnails at 144, which is
+ ok to scale up from 128. */
+ if (modified_size > 128*1.25 &&
!file->details->thumbnail_wants_original) {
/* Invalidate if we resize upward */
file->details->thumbnail_wants_original = TRUE;
diff --git a/src/file-manager/fm-icon-container.c b/src/file-manager/fm-icon-container.c
index 6731f1e66..54b86d988 100644
--- a/src/file-manager/fm-icon-container.c
+++ b/src/file-manager/fm-icon-container.c
@@ -99,6 +99,9 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container,
if (!fm_icon_view_is_compact (icon_view) ||
nautilus_icon_container_get_zoom_level (container) > NAUTILUS_ZOOM_LEVEL_STANDARD) {
flags |= NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS;
+ if (fm_icon_view_is_compact (icon_view)) {
+ flags |= NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE;
+ }
}
if (use_embedding) {