summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index b69083818..98c27dc20 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -3453,6 +3453,9 @@ ghb_pause_queue()
}
}
+#define RED_HEIGHT 720.0
+#define RED_WIDTH 1280.0
+
GdkPixbuf*
ghb_get_preview_image(
gint titleindex,
@@ -3589,6 +3592,21 @@ ghb_get_preview_image(
else
dstHeight = dstHeight * par_height / par_width;
}
+ if (ghb_settings_get_boolean(settings, "reduce_hd_preview"))
+ {
+ gdouble factor = 1.0;
+
+ if (dstHeight > RED_HEIGHT)
+ {
+ factor = RED_HEIGHT / (gdouble)dstHeight;
+ }
+ if (dstWidth * factor > RED_WIDTH)
+ {
+ factor = RED_WIDTH / (gdouble)dstWidth;
+ }
+ dstHeight = dstHeight * factor + 0.5;
+ dstWidth = dstWidth * factor + 0.5;
+ }
g_debug("scaled %d x %d\n", dstWidth, dstHeight);
GdkPixbuf *scaled_preview;