File: image-decoders.patch

package info (click to toggle)
rust-termwiz 0.22.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,036 kB
  • sloc: sh: 10,450; makefile: 18
file content (29 lines) | stat: -rw-r--r-- 1,565 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: patch image decoders
 Decoders requires the data passed to implement 'Seek'.
Author: Ananthu C V <weepingclown@debian.org>
Forwarded: not-needed
Last-Update: 2024-12-14
--- a/src/image.rs
+++ b/src/image.rs
@@ -390,3 +390,3 @@
                 match format {
-                    ImageFormat::Gif => image::codecs::gif::GifDecoder::new(&*data)
+                    ImageFormat::Gif => image::codecs::gif::GifDecoder::new(std::io::Cursor::new(&data))
                         .and_then(|decoder| decoder.into_frames().collect_frames())
@@ -408,3 +408,3 @@
                     ImageFormat::Png => {
-                        let decoder = match image::codecs::png::PngDecoder::new(&*data) {
+                        let decoder = match image::codecs::png::PngDecoder::new(std::io::Cursor::new(&data)) {
                             Ok(d) => d,
@@ -412,4 +412,4 @@
                         };
-                        if decoder.is_apng() {
-                            match decoder.apng().into_frames().collect_frames() {
+                        if decoder.is_apng().unwrap() {
+                            match decoder.apng().unwrap().into_frames().collect_frames() {
                                 Ok(frames) if frames.is_empty() => {
@@ -426,3 +426,3 @@
                     ImageFormat::WebP => {
-                        let decoder = match image::codecs::webp::WebPDecoder::new(&*data) {
+                        let decoder = match image::codecs::webp::WebPDecoder::new(std::io::Cursor::new(&data)) {
                             Ok(d) => d,