Fix the progressive decoding bug on macOS. Including image orientation & SDAnimatedimageView
This commit is contained in:
parent
0a0bdc92db
commit
a34133b864
|
@ -46,7 +46,7 @@
|
|||
// AppKit design is different from UIKit. Where CGImage based image rep does not respect to any orientation. Only data based image rep which contains the EXIF metadata can automatically detect orientation.
|
||||
// This should be nonnull, until the memory is exhausted cause `CGBitmapContextCreate` failed.
|
||||
CGImageRef rotatedCGImage = [SDImageCoderHelper CGImageCreateDecoded:cgImage orientation:orientation];
|
||||
imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
||||
imageRep = [[NSBitmapImageRep alloc] initWithCGImage:rotatedCGImage];
|
||||
CGImageRelease(rotatedCGImage);
|
||||
} else {
|
||||
imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
||||
|
|
|
@ -322,6 +322,9 @@ dispatch_semaphore_signal(self->_lock);
|
|||
}
|
||||
|
||||
[self.layer setNeedsDisplay];
|
||||
#if SD_MAC
|
||||
[self.layer displayIfNeeded]; // macOS's imageViewLayer is not equal to self.layer. But `[super setImage:]` will impliedly mark it needsDisplay. We call `[self.layer displayIfNeeded]` to immediately refresh the imageViewLayer to avoid flashing
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue