fix: avoid rescaling horizontal images

This commit is contained in:
2026-07-14 00:03:39 +02:00
parent 67bc375e17
commit 9baba413d3
+6 -4
View File
@@ -1637,11 +1637,13 @@ class ImageLoader {
if token.isCancelled { finish(nil); return }
guard var image = UIImage(data: extractedData) else {
guard let image = UIImage(data: extractedData) else {
finish(nil)
return
}
var finalImage: UIImage!
if token.isCancelled { finish(nil); return }
// If you turn pages fast, completion will not be nil and as such only the needed scaled image should be prepared
@@ -1661,7 +1663,7 @@ class ImageLoader {
print("this should be unreachable")
return
}
if rotation == .vertical { image = vScaleImage }
if rotation == .vertical { finalImage = vScaleImage }
}
if token.isCancelled { finish(nil); return }
@@ -1682,10 +1684,10 @@ class ImageLoader {
print("this should be unreachable")
return
}
if rotation == .horizontal { image = hScaleImage }
if rotation == .horizontal { finalImage = hScaleImage }
}
finish(image)
finish(finalImage)
}
}