Hello,
what is the correct way to handle scale and downsampling via SDImageResizingTransformer?
I noticed a large usage of RAM memory when loading images in my app. When I applied downsampling as below, the usage got 9x lower (as the math suggests) but now I am worried about the image quality (I haven't tested it for any differences yet). I would like to hear how such case is handled correctly.
Let's say I have an URL to 600x900 image and a view with .frame(width: 200, height: 300).
- Should I multiply the CGSize by
UIScreen.main.scale or just leave it 200x300?
- Should I even use the
.imageScaleFactor param? Is UIScreen.main.scale correct here?
- Should I use
.scaleDownLargeImages option? I haven't noticed any difference here.
WebImage(
url: url,
options: [.scaleDownLargeImages], // should I use it?
context: [
.imageScaleFactor: UIScreen.main.scale, // 2 or 3, depending on the device
.imageTransformer: SDImageResizingTransformer(
size: CGSize(width: 200, height: 300),
scaleMode: .aspectFit
)
]
)
BR
Hello,
what is the correct way to handle scale and downsampling via SDImageResizingTransformer?
I noticed a large usage of RAM memory when loading images in my app. When I applied downsampling as below, the usage got 9x lower (as the math suggests) but now I am worried about the image quality (I haven't tested it for any differences yet). I would like to hear how such case is handled correctly.
Let's say I have an URL to 600x900 image and a view with
.frame(width: 200, height: 300).UIScreen.main.scaleor just leave it 200x300?.imageScaleFactorparam? IsUIScreen.main.scalecorrect here?.scaleDownLargeImagesoption? I haven't noticed any difference here.BR