[librsvg] rsvg-convert: Remove redundant code for zlib decompression
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] rsvg-convert: Remove redundant code for zlib decompression
- Date: Fri, 21 Oct 2016 21:21:39 +0000 (UTC)
commit 8b834834abecf9cb492216d29b6d634a8c5aa35d
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Oct 21 12:10:41 2016 -0500
rsvg-convert: Remove redundant code for zlib decompression
The gio streaming machinery inside librsvg already knows how to
sniff the incoming data for zlib compression; we don't need
to explicitly create a decompressor stream here.
rsvg-convert.c | 28 ----------------------------
1 files changed, 0 insertions(+), 28 deletions(-)
---
diff --git a/rsvg-convert.c b/rsvg-convert.c
index 1e3ed05..34b48db 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -260,37 +260,9 @@ main (int argc, char **argv)
stream = g_unix_input_stream_new (STDIN_FILENO, FALSE);
#endif
} else {
- GFileInfo *file_info;
- gboolean compressed = FALSE;
-
file = g_file_new_for_commandline_arg (args[i]);
stream = (GInputStream *) g_file_read (file, NULL, &error);
- 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);
- }
-
- if (compressed) {
- GZlibDecompressor *decompressor;
- GInputStream *converter_stream;
-
- decompressor = g_zlib_decompressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP);
- converter_stream = g_converter_input_stream_new (stream, G_CONVERTER (decompressor));
- g_object_unref (stream);
- stream = converter_stream;
- }
-
if (stream == NULL)
goto done;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]