From 2ff79730d813e8c04a42c8e12b33c5ed73005d80 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Thu, 7 Feb 2008 18:39:05 +0000 Subject: MacGui: fix picture sizing issue in presets where creating a preset using an HD source (ie. 960 x 544) and then using that preset on a smaller source (ie. dvd) would cause the smaller source to be upscaled to the larger size. Now preset is restricted to scale no larger than the current source regardless of size when it was created. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1252 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 769f4039a..d8ce1bfd9 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -3422,8 +3422,19 @@ if (item == nil) } else // /* If not 0 or 2 we assume objectForKey:@"UsesPictureSettings is 1 which is "Use picture sizing from when the preset was set" */ { - job->width = [[chosenPreset objectForKey:@"PictureWidth"] intValue]; - job->height = [[chosenPreset objectForKey:@"PictureHeight"] intValue]; + /* we check to make sure the presets width/height does not exceed the sources width/height */ + if (fTitle->width < [[chosenPreset objectForKey:@"PictureWidth"] intValue] || fTitle->height < [[chosenPreset objectForKey:@"PictureHeight"] intValue]) + { + /* if so, then we use the sources height and width to avoid scaling up */ + job->width = fTitle->width; + job->height = fTitle->height; + } + else // source width/height is >= the preset height/width + { + /* we can go ahead and use the presets values for height and width */ + job->width = [[chosenPreset objectForKey:@"PictureWidth"] intValue]; + job->height = [[chosenPreset objectForKey:@"PictureHeight"] intValue]; + } job->keep_ratio = [[chosenPreset objectForKey:@"PictureKeepRatio"] intValue]; if (job->keep_ratio == 1) { -- cgit v1.2.3