summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/callbacks.c4
-rw-r--r--gtk/src/hb-backend.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 13d270f15..db77248d2 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1008,8 +1008,8 @@ ghb_set_widget_ranges(signal_user_data_t *ud, GValue *settings)
// Set the limits of cropping. hb_set_anamorphic_size crashes if
// you pass it a cropped width or height == 0.
gint vbound, hbound;
- vbound = title->height / 2 - 8;
- hbound = title->width / 2 - 8;
+ vbound = title->height;
+ hbound = title->width;
val = ghb_settings_get_int(ud->settings, "PictureTopCrop");
spin_configure(ud, "PictureTopCrop", val, 0, vbound);
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);