(name *string, data *[]byte)
| 286 | } |
| 287 | |
| 288 | func (b *Btelegram) maybeConvertTgs(name *string, data *[]byte) { |
| 289 | format := b.GetString("MediaConvertTgs") |
| 290 | if helper.SupportsFormat(format) { |
| 291 | b.Log.Debugf("Format supported by %s, converting %v", helper.LottieBackend(), name) |
| 292 | } else { |
| 293 | // Otherwise, no conversion was requested. Trying to run the usual webp |
| 294 | // converter would fail, because '.tgs.webp' is actually a gzipped JSON |
| 295 | // file, and has nothing to do with WebP. |
| 296 | return |
| 297 | } |
| 298 | err := helper.ConvertTgsToX(data, format, b.Log) |
| 299 | if err != nil { |
| 300 | b.Log.Errorf("conversion failed: %v", err) |
| 301 | } else { |
| 302 | *name = strings.Replace(*name, "tgs.webp", format, 1) |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | func (b *Btelegram) maybeConvertWebp(name *string, data *[]byte) { |
| 307 | if b.GetBool("MediaConvertWebPToPNG") { |
no test coverage detected