summaryrefslogtreecommitdiff
blob: cbec1a547e40ea3092bd1c64189d2d1e632241ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# https://bugs.gentoo.org/show_bug.cgi?id=261219
# https://bugzilla.gnome.org/show_bug.cgi?id=574708
#
#        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
#
--- a/libnautilus-private/nautilus-file.c	2009/03/16 12:13:10	15121
+++ b/libnautilus-private/nautilus-file.c	2009/03/16 14:18:13	15122
@@ -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;
--- a/src/file-manager/fm-icon-container.c	2009/03/16 12:13:10	15121
+++ b/src/file-manager/fm-icon-container.c	2009/03/16 14:18:13	15122
@@ -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) {