Procházet zdrojové kódy

Fix ThumbnailImageDataProvider image orientation issue

Add kCGImageSourceCreateThumbnailWithTransform option to ensure thumbnail
images respect the original image's EXIF orientation data. Without this
option, thumbnails could appear rotated compared to the original image
as seen by users.

Fixes #2395
onevcat před 8 měsíci
rodič
revize
922c245144

+ 2 - 1
Sources/General/ImageSource/ImageDataProvider.swift

@@ -245,7 +245,8 @@ public struct ThumbnailImageDataProvider: ImageDataProvider {
                 
                 let options = [
                     kCGImageSourceThumbnailMaxPixelSize: maxPixelSize,
-                    kCGImageSourceCreateThumbnailFromImageAlways: alwaysCreateThumbnail
+                    kCGImageSourceCreateThumbnailFromImageAlways: alwaysCreateThumbnail,
+                    kCGImageSourceCreateThumbnailWithTransform: true
                 ]
                 
                 guard let thumbnailRef = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options as CFDictionary) else {