Fix #192: tiff files (and others) appear blurry when 1:1 view
authorColin Clark <colin.clark@cclark.uk>
Fri, 4 Aug 2017 16:04:07 +0000 (17:04 +0100)
committerColin Clark <colin.clark@cclark.uk>
Fri, 4 Aug 2017 16:04:07 +0000 (17:04 +0100)
https://github.com/BestImageViewer/geeqie/issues/192

Up to commit 808d8558b3d5 alpha-channel files at scale 1:1 always had
GdkInterpType set to GDK_INTERP_NEAREST - the lowest quality. As there
was no scaling, this was ok.
Thereafter scaling was set to that selected by the user, resulting in
problems when GDK_INTERP_HYPER was selected.
This commit reverts to the previous method.

src/renderer-tiles.c

index 6a034e1..9279270 100644 (file)
@@ -1270,7 +1270,7 @@ static void rt_tile_get_region(gboolean has_alpha,
                                         offset_x,
                                         offset_y,
                                         scale_x, scale_y,
-                                        interp_type,
+                                        (scale_x == 1.0 && scale_y == 1.0) ? GDK_INTERP_NEAREST : interp_type,
                                         255, check_x, check_y,
                                         PR_ALPHA_CHECK_SIZE,
                                         ((options->image.alpha_color_1.red << 8 & 0x00FF0000) +