forked from edgardoh/darktable
-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is based on those 3 rules: - Max size is not "max" size acutally but more like "requested" size. - Resizing by scaling factor or by max size are independent and select one will cover the other value, because user cannot see both in UI. - We don't do upscaling when exporting. So the actual logic on determine final size is simple: 1. If user sets both dimensions <= 0 (setting scaling factor is also setting both dimensions), this means don't resize and use the original image size. 2. For max size, if user sets one dimension <= 0, this means calculate the other dimension via image ratio. 3. For max size, if user does not set dimensions according to image ratio, we match the longest dimension, and calculate the other dimension via image ratio. 4. If user sets value > original image size, this also means don't resize and use the original image size. 5. If by scaling factor, calculate max size according to scaling factor. If by max size, calculate scaling factor according to max size. 6. Limit size by max size, and pass correct size and scaling factor to pixelpipe. Fixes <#362>.
- Loading branch information
Showing
1 changed file
with
66 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters