diff options
author | dynaflash <[email protected]> | 2007-08-29 14:26:57 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-08-29 14:26:57 +0000 |
commit | 8d1c8819a2695068d7999e74368bdb4401827f05 (patch) | |
tree | 37e2950b6829a689a279e2edf726f91be5d3ee47 | |
parent | 28a00347776cdcaa9b2d4cc0e5855089bc0c4f76 (diff) |
MacGui: Fix Picture Preview crash when sizing below 16 pixels width or height.
- Set width and height stepper minimums to 32 px
- use sanity conditional for accessing hb_get_preview() so below 32 px either way the preview does not change
- Used 32 threshold since afaik, no human being can discern any meaningful detail from a 32 px image anyway
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@892 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/PictureController.mm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm index aa3bcadff..1fa248bde 100644 --- a/macosx/PictureController.mm +++ b/macosx/PictureController.mm @@ -32,10 +32,10 @@ static int GetAlignedSize( int size ) [fWidthStepper setValueWraps: NO]; [fWidthStepper setIncrement: 16]; - [fWidthStepper setMinValue: 16]; + [fWidthStepper setMinValue: 32]; [fHeightStepper setValueWraps: NO]; [fHeightStepper setIncrement: 16]; - [fHeightStepper setMinValue: 16]; + [fHeightStepper setMinValue: 32]; [fCropTopStepper setIncrement: 2]; [fCropTopStepper setMinValue: 0]; @@ -347,7 +347,15 @@ static int GetAlignedSize( int size ) [fCropLeftField setIntValue: job->crop[2]]; [fCropRightStepper setIntValue: job->crop[3]]; [fCropRightField setIntValue: job->crop[3]]; + /* Sanity Check Here for < 16 px preview to avoid + crashing hb_get_preview. In fact, just for kicks + lets getting previews at a min limit of 32, since + no human can see any meaningful detail below that */ + if (job->width >= 32 && job->height >= 32) + { [self Display: HB_ANIMATE_NONE]; + } + } - (IBAction) PreviousPicture: (id) sender |