@@ -177,7 +177,8 @@ __strong void(^cleanupBlock)(void) __attribute__((cleanup(sd_executeCleanupBlock
177
177
JxlBasicInfo info;
178
178
status = JxlDecoderGetBasicInfo (dec, &info);
179
179
if (status != JXL_DEC_SUCCESS) return nil ;
180
- CGImagePropertyOrientation exifOrientation = (CGImagePropertyOrientation)info.orientation ;
180
+ // By defaults, libjxl applys transform for orientation, unless we call `JxlDecoderSetKeepOrientation`
181
+ // CGImagePropertyOrientation exifOrientation = (CGImagePropertyOrientation)info.orientation;
181
182
182
183
// colorspace
183
184
size_t profileSize;
@@ -212,10 +213,9 @@ __strong void(^cleanupBlock)(void) __attribute__((cleanup(sd_executeCleanupBlock
212
213
return nil ;
213
214
}
214
215
#if SD_MAC
215
- UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: exifOrientation ];
216
+ UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: kCGImagePropertyOrientationUp ];
216
217
#else
217
- UIImageOrientation orientation = [SDImageCoderHelper imageOrientationFromEXIFOrientation: exifOrientation];
218
- UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: orientation];
218
+ UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: UIImageOrientationUp];
219
219
#endif
220
220
CGImageRelease (imageRef);
221
221
@@ -237,10 +237,9 @@ __strong void(^cleanupBlock)(void) __attribute__((cleanup(sd_executeCleanupBlock
237
237
CGImageRef imageRef = [self sd_createJXLImageWithDec: dec info: info colorSpace: colorSpaceRef thumbnailSize: thumbnailSize preserveAspectRatio: preserveAspectRatio];
238
238
if (!imageRef) continue ;
239
239
#if SD_MAC
240
- UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: exifOrientation ];
240
+ UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: kCGImagePropertyOrientationUp ];
241
241
#else
242
- UIImageOrientation orientation = [SDImageCoderHelper imageOrientationFromEXIFOrientation: exifOrientation];
243
- UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: orientation];
242
+ UIImage *image = [[UIImage alloc ] initWithCGImage: imageRef scale: scale orientation: UIImageOrientationUp];
244
243
#endif
245
244
CGImageRelease (imageRef);
246
245
0 commit comments