summarylogtreecommitdiffstats
path: root/10-7z.patch
blob: 47aec68c6a14c8e55f0dbf6d3c95664f25de7ef5 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- a/gif2apng.cpp
+++ b/gif2apng.cpp
@@ -31,10 +31,20 @@
 #include <stdlib.h>
 #include <string.h>
 #include "zlib.h"
-#include "7z.h"
+
+#ifdef ENABLE_7Z
+  #include "7z.h"
+#endif
+
+#ifdef ENABLE_LOCAL_ZOPFLI
 extern "C" {
 #include "zopfli.h"
 }
+#else
+extern "C" {
+#include "zopfli/zopfli.h"
+}
+#endif
 
 #if defined(_MSC_VER) && _MSC_VER >= 1300
 #define swap16(data) _byteswap_ushort(data)
@@ -289,8 +299,10 @@ void deflate_rect_fin(int deflate_method
   if (deflate_method == 1)
   {
     unsigned size = zbuf_size;
+#ifdef ENABELE_7Z
     compress_rfc1950_7z(rows, op[n].h*(rowbytes + 1), zbuf, size, iter<100 ? iter : 100, 255);
     *zsize = size;
+#endif
   }
   else
   {
@@ -450,7 +462,7 @@ int main(int argc, char** argv)
   int              trns_size = 0;
   int              ssize = 0;
   int              keep_palette = 0;
-  int              deflate_method = 1;
+  int              deflate_method = 0;
   int              iter = 15;
 
   unsigned char  * buffer;
@@ -473,7 +485,7 @@ int main(int argc, char** argv)
   {
     printf("\n\nUsage: gif2apng [options] anim.gif [anim.png]\n\n"
            "-z0  : zlib compression\n"
-           "-z1  : 7zip compression (default)\n"
+           //"-z1  : 7zip/lzma compression (default)\n"
            "-z2  : zopfli compression\n"
            "-i## : number of iterations, default -i%d\n"
            "-kp  : keep the palette\n", iter);
@@ -520,7 +532,8 @@ int main(int argc, char** argv)
   if (deflate_method == 0)
     printf(" using ZLIB\n\n");
   else if (deflate_method == 1)
-    printf(" using 7ZIP with %d iterations\n\n", iter);
+    deflate_method = 0; // 7zip not supported
+    // printf(" using 7ZIP with %d iterations\n\n", iter);
   else if (deflate_method == 2)
     printf(" using ZOPFLI with %d iterations\n\n", iter);