UIImage instances that are created from JPEGs have imageOrientation set accordingly.
When an image is later saved to the disk in JPEG format, the orientation is persisted too in EXIF information. Therefore, when it's loaded later on from disk, it has the correct orientation.
However, Kingfisher is using PNG serialization rather than JPEG that doesn't support the rotation flag (metadata about orientation is not persisted). source: http://stackoverflow.com/a/4868914/1161723
There are two possible solutions:
1) Use UIImageJPEGRepresentation instead of UIImagePNGRepresentation when saving an image to disk
2) Rotate the instance of UIImage using its imageOrientation property before saving it to disk as a PNG image, possible implementation could look like this (objc code): http://stackoverflow.com/a/5427890/1161723
Most helpful comment
There are two possible solutions:
1) Use
UIImageJPEGRepresentationinstead of UIImagePNGRepresentation when saving an image to disk2) Rotate the instance of
UIImageusing itsimageOrientationproperty before saving it to disk as a PNG image, possible implementation could look like this (objc code): http://stackoverflow.com/a/5427890/1161723