summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-03-03 16:47:18 +0000
committerjstebbins <[email protected]>2014-03-03 16:47:18 +0000
commit1ea78b3a154253ebb292244e8da0ed0980705bec (patch)
tree4c461ad7e930627492179d29af666f824bc1adcd /gtk/src/hb-backend.c
parent8f4098ff907b3e1c36ecf9c0dcbf83b296cb0a2d (diff)
LinGui: allow more flexibility in manual cropping
Do not limit cropping to half of width or height. Instead, just make sure resulting image width and height are never less than 16. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6096 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 057625375..f6b7021d0 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -3509,6 +3509,15 @@ ghb_set_scale_settings(GValue *settings, gint mode)
crop[1] = ghb_settings_get_int(settings, "PictureBottomCrop");
crop[2] = ghb_settings_get_int(settings, "PictureLeftCrop");
crop[3] = ghb_settings_get_int(settings, "PictureRightCrop");
+ // Prevent manual crop from creating too small an image
+ if (title->height - crop[0] < crop[1] + 16)
+ {
+ crop[0] = title->height - crop[1] - 16;
+ }
+ if (title->width - crop[2] < crop[3] + 16)
+ {
+ crop[2] = title->width - crop[3] - 16;
+ }
}
if (noscale)
{
@@ -3558,9 +3567,9 @@ ghb_set_scale_settings(GValue *settings, gint mode)
g_debug("max_width %d, max_height %d\n", max_width, max_height);
if (width < 16)
- width = title->width - crop[2] - crop[3];
+ width = 16;
if (height < 16)
- height = title->height - crop[0] - crop[1];
+ height = 16;
width = MOD_ROUND(width, mod);
height = MOD_ROUND(height, mod);