Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, so I ran into a problem. I have a required design, and minimal control over my content pipeline. So I rely heavily on client side optimizations. I am only recently trying Nuke, and love it so far, but ran into a little snag, line 157 of ImageProcessing.swift. This
CGFloat(min(scale, 1))
in particular.What this means is you wouldn't expect anyone to need to upscale an image. Though I use client-side image processing for 2 main reasons (among others).
The problem is, the images I get back are just slightly smaller than the views they are displayed in, so with this, and the the maximum of scale 1, means the only option is to use UIImageView scaling again. Basically, that makes the Nuke targetSize transformation a bit pointless for this case.
So when trying to figure out the best approach, I couldn't really decide, but chose one to make a pull request. Here are some thoughts:
CGFloat(min(scale, 1))
and just use the scale as is. Allowing upscaling by default.aspectFillWithUpscaling
andaspectFitWithUpscaling
aspectFill(true)
oraspectFit(false)
For this PR as you can see I went with 4, and it defaults to
false
because I am no stranger to open source, and I understand how important backward compatibility can be.So let me know your thoughts. In the mean time, I am using a fork with my changes in number 4 applied.