nautilus r15122 - in trunk: . libnautilus-private src/file-manager
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r15122 - in trunk: . libnautilus-private src/file-manager
- Date: Mon, 16 Mar 2009 14:18:13 +0000 (UTC)
Author: alexl
Date: Mon Mar 16 14:18:13 2009
New Revision: 15122
URL: http://svn.gnome.org/viewvc/nautilus?rev=15122&view=rev
Log:
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
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-file.c
trunk/src/file-manager/fm-icon-container.c
Modified: trunk/libnautilus-private/nautilus-file.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file.c (original)
+++ trunk/libnautilus-private/nautilus-file.c Mon Mar 16 14:18:13 2009
@@ -3579,27 +3579,17 @@
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;
Modified: trunk/src/file-manager/fm-icon-container.c
==============================================================================
--- trunk/src/file-manager/fm-icon-container.c (original)
+++ trunk/src/file-manager/fm-icon-container.c Mon Mar 16 14:18:13 2009
@@ -99,6 +99,9 @@
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) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]