[librsvg] test-display.c: Remove redundant code for zlib decompression



commit f2edb0c6dc65318f4ee2c154fb700c74632e81e5
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Oct 21 16:42:07 2016 -0500

    test-display.c: Remove redundant code for zlib decompression
    
    Same as for rsvg-convert; librsvg can already deal with .svgz by itself.

 test-display.c |   26 --------------------------
 1 files changed, 0 insertions(+), 26 deletions(-)
---
diff --git a/test-display.c b/test-display.c
index 712a775..fcce33b 100644
--- a/test-display.c
+++ b/test-display.c
@@ -596,7 +596,6 @@ main (int argc, char **argv)
     gboolean unlimited = FALSE;
     char *id = NULL;
     GInputStream *input;
-    GFileInfo *file_info;
     gboolean compressed;
     GFile *file, *base_file;
     cairo_surface_t *surface;
@@ -695,21 +694,6 @@ main (int argc, char **argv)
         else
             base_file = g_object_ref (file);
 
-        if ((file_info = g_file_query_info (file,
-                                            G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
-                                            G_FILE_QUERY_INFO_NONE,
-                                            NULL,
-                                            NULL))) {
-            const char *content_type;
-            char *gz_content_type;
-
-            content_type = g_file_info_get_content_type (file_info);
-            gz_content_type = g_content_type_from_mime_type ("application/x-gzip");
-            compressed = (content_type != NULL && g_content_type_is_a (content_type, gz_content_type));
-            g_free (gz_content_type);
-            g_object_unref (file_info);
-        }
-
         g_object_unref (file);
     }
 
@@ -721,16 +705,6 @@ main (int argc, char **argv)
         return 1;
     }
 
-    if (compressed) {
-        GZlibDecompressor *decompressor;
-        GInputStream *converter_stream;
-
-        decompressor = g_zlib_decompressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP);
-        converter_stream = g_converter_input_stream_new (input, G_CONVERTER (decompressor));
-        g_object_unref (input);
-        input = converter_stream;
-    }
-
     info.base_uri = base_file ? g_file_get_uri (base_file) : g_strdup ("");
     info.id = id;
     info.x_zoom = x_zoom;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]