mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
Dont scan all pixels of JPEG images when EXIF rotated to check for opacity
This commit is contained in:
@@ -28,7 +28,13 @@ func resize_frame(imgd *image_data, img image.Image) (image.Image, image.Rectang
|
|||||||
}
|
}
|
||||||
|
|
||||||
func add_frame(imgd *image_data, img image.Image) *image_frame {
|
func add_frame(imgd *image_data, img image.Image) *image_frame {
|
||||||
is_opaque := images.IsOpaque(img)
|
is_opaque := false
|
||||||
|
if imgd.format_uppercase == "JPEG" {
|
||||||
|
// special cased because EXIF orientation could have already changed this image to an NRGBA making IsOpaque() very slow
|
||||||
|
is_opaque = true
|
||||||
|
} else {
|
||||||
|
is_opaque = images.IsOpaque(img)
|
||||||
|
}
|
||||||
b := img.Bounds()
|
b := img.Bounds()
|
||||||
if imgd.scaled_frac.x != 0 {
|
if imgd.scaled_frac.x != 0 {
|
||||||
img, b = resize_frame(imgd, img)
|
img, b = resize_frame(imgd, img)
|
||||||
|
|||||||
Reference in New Issue
Block a user