diff options
author | dynaflash <[email protected]> | 2008-02-07 18:39:05 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2008-02-07 18:39:05 +0000 |
commit | 2ff79730d813e8c04a42c8e12b33c5ed73005d80 (patch) | |
tree | 344f5b25ae070d71a2fd13acef605279390d7e09 | |
parent | ec3eeec625cd5e53842bae93329806e35191788c (diff) |
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
-rw-r--r-- | macosx/Controller.mm | 15 |
1 files 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) { |