mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 14:34:52 +02:00
icat: Report panics in the render function correctly
Also, only fallback to imagemagick on error when the engine is not specified as builtin
This commit is contained in:
@@ -24,16 +24,17 @@ func (self *Context) run_paste(src imaging.Scanner, background image.Image, pos
|
||||
var pix []uint8
|
||||
switch v := background.(type) {
|
||||
case *image.NRGBA:
|
||||
i := background.(*image.NRGBA)
|
||||
stride = i.Stride
|
||||
pix = i.Pix
|
||||
stride = v.Stride
|
||||
pix = v.Pix
|
||||
case *imaging.NRGB:
|
||||
i := background.(*imaging.NRGB)
|
||||
stride = i.Stride
|
||||
pix = i.Pix
|
||||
stride = v.Stride
|
||||
pix = v.Pix
|
||||
default:
|
||||
panic(fmt.Sprintf("Unsupported image type: %v", v))
|
||||
}
|
||||
if len(pix) != background.Bounds().Dy()*stride {
|
||||
panic(fmt.Sprintf("background image has insufficient pixel data. Bounds: %v Stride: %d", background.Bounds(), stride))
|
||||
}
|
||||
if err := self.SafeParallel(interRect.Min.Y, interRect.Max.Y, func(ys <-chan int) {
|
||||
for y := range ys {
|
||||
x1 := interRect.Min.X - pasteRect.Min.X
|
||||
|
||||
Reference in New Issue
Block a user