icat: Dont try to further compress PNG images when using stream based transmission
This commit is contained in:
parent
a73f09cf89
commit
5eaa935ede
@ -332,7 +332,7 @@ sequence of escape codes to the terminal emulator::
|
|||||||
Note that only the first escape code needs to have the full set of control
|
Note that only the first escape code needs to have the full set of control
|
||||||
codes such as width, height, format, etc. Subsequent chunks **must** have only
|
codes such as width, height, format, etc. Subsequent chunks **must** have only
|
||||||
the ``m`` and optionally ``q`` keys. When sending animation frame data, subsequent
|
the ``m`` and optionally ``q`` keys. When sending animation frame data, subsequent
|
||||||
chunks must also specify the ``a=f`` key. The client **must** finish sending
|
chunks **must** also specify the ``a=f`` key. The client **must** finish sending
|
||||||
all chunks for a single image before sending any other graphics related escape
|
all chunks for a single image before sending any other graphics related escape
|
||||||
codes. Note that the cursor position used to display the image **must** be the
|
codes. Note that the cursor position used to display the image **must** be the
|
||||||
position when the final chunk is received. Finally, terminals must not display
|
position when the final chunk is received. Finally, terminals must not display
|
||||||
|
|||||||
@ -544,14 +544,14 @@ func (self *GraphicsCommand) WriteWithPayloadTo(o io.StringWriter, payload []byt
|
|||||||
return self.serialize_to(o, base64.StdEncoding.EncodeToString(payload))
|
return self.serialize_to(o, base64.StdEncoding.EncodeToString(payload))
|
||||||
}
|
}
|
||||||
gc := *self
|
gc := *self
|
||||||
compressed := compress_with_zlib(payload)
|
if self.Format() != GRT_format_png {
|
||||||
if len(compressed) < len(payload) {
|
compressed := compress_with_zlib(payload)
|
||||||
gc.SetCompression(GRT_compression_zlib)
|
if len(compressed) < len(payload) {
|
||||||
gc.SetDataSize(uint64(len(payload)))
|
gc.SetCompression(GRT_compression_zlib)
|
||||||
payload = compressed
|
payload = compressed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data := base64.StdEncoding.EncodeToString(payload)
|
data := base64.StdEncoding.EncodeToString(payload)
|
||||||
is_first := true
|
|
||||||
for len(data) > 0 && err == nil {
|
for len(data) > 0 && err == nil {
|
||||||
chunk := data
|
chunk := data
|
||||||
if len(data) > 4096 {
|
if len(data) > 4096 {
|
||||||
@ -569,10 +569,7 @@ func (self *GraphicsCommand) WriteWithPayloadTo(o io.StringWriter, payload []byt
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !is_first {
|
gc = GraphicsCommand{q: self.q, a: self.a}
|
||||||
gc = GraphicsCommand{}
|
|
||||||
}
|
|
||||||
is_first = false
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user