Commit 8bb6faf3 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

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
parent e2a96cc5
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:
......
......@@ -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;
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment