From: Jaroslav Kysela Date: Thu, 14 May 2015 19:19:10 +0000 (+0200) Subject: webui: file bundle - don't compress .gz files twice, fixes #2845 X-Git-Tag: v4.1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdd0eb65523174acb0e2542b743417b97061e84a;p=thirdparty%2Ftvheadend.git webui: file bundle - don't compress .gz files twice, fixes #2845 --- diff --git a/support/mkbundle b/support/mkbundle index 83eaf412a..00057095c 100755 --- a/support/mkbundle +++ b/support/mkbundle @@ -76,7 +76,12 @@ def output_file ( path, name, idx, next = -1 ): outf.write('static const uint8_t filebundle_data_%06d[] = {' % idx) o = -1 d = open(p, 'rb').read() - if opts.gzip: + if p.endswith('.gz'): + t = BytesIO(d) + z = gzip.GzipFile(filename=name, mode='r', fileobj=t) + nd = z.read() + o = len(nd) + elif opts.gzip: o = len(d) l = opts.gzlevel t = BytesIO()