mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Fix transmission by file
This commit is contained in:
parent
c6582e9f51
commit
2ac2c17929
2 changed files with 6 additions and 4 deletions
|
|
@ -179,9 +179,7 @@ func (self *GraphicsHandler) transmit(lp *loop.Loop, img *images.ImageData, m *i
|
|||
gc := self.new_graphics_command()
|
||||
gc.SetImageId(self.image_transmitted)
|
||||
gc.SetDataWidth(uint64(frame.Width)).SetDataHeight(uint64(frame.Height))
|
||||
if frame.Is_opaque {
|
||||
gc.SetFormat(graphics.GRT_format_rgb)
|
||||
}
|
||||
gc.SetFormat(utils.IfElse(frame.Is_opaque, graphics.GRT_format_rgb, graphics.GRT_format_rgba))
|
||||
switch frame_num {
|
||||
case 0:
|
||||
gc.SetAction(graphics.GRT_action_transmit)
|
||||
|
|
@ -285,7 +283,7 @@ func (self *GraphicsHandler) RenderImagePreview(h *Handler, p *ImagePreview, x,
|
|||
}
|
||||
}
|
||||
if files_supported {
|
||||
self.transmit(h.lp, img, img_metadata, p.cached_data)
|
||||
self.transmit(h.lp, img, img_metadata, cached_data)
|
||||
} else {
|
||||
if img == nil {
|
||||
if img, err = load_image(cached_data); err != nil {
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ type SerializableImageFrame struct {
|
|||
Size int
|
||||
}
|
||||
|
||||
func (s SerializableImageFrame) NeededSize() int {
|
||||
return utils.IfElse(s.Is_opaque, 3, 4) * s.Width * s.Height
|
||||
}
|
||||
|
||||
func (s *ImageFrame) Serialize() SerializableImageFrame {
|
||||
return SerializableImageFrame{
|
||||
Width: s.Width, Height: s.Height, Left: s.Left, Top: s.Top,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue