summary refs log tree commit diff
path: root/bin/pngo.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pngo.c')
-rw-r--r--bin/pngo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/pngo.c b/bin/pngo.c
index 47ca4d9b..88a49365 100644
--- a/bin/pngo.c
+++ b/bin/pngo.c
@@ -402,11 +402,19 @@ static void reconData(void) {
 
 static void filterData(void) {
     for (uint32_t y = header.height - 1; y < header.height; --y) {
+        if (header.color == INDEXED || header.depth < 8) {
+            *lines[y].type = NONE;
+            for (size_t i = lineSize() - 1; i < lineSize(); --i) {
+                lines[y].data[i] = filt(NONE, origBytes(y, i));
+            }
+            continue;
+        }
+
         uint8_t filter[FILTER_COUNT][lineSize()];
         uint32_t heuristic[FILTER_COUNT] = { 0 };
         enum Filter minType = NONE;
         for (enum Filter type = NONE; type < FILTER_COUNT; ++type) {
-            for (uint32_t i = 0; i < lineSize(); ++i) {
+            for (size_t i = 0; i < lineSize(); ++i) {
                 filter[type][i] = filt(type, origBytes(y, i));
                 heuristic[type] += abs((int8_t)filter[type][i]);
             }
a href='/litterbox/commit/database.h?h=1.5&id=1140dfdd3d6bbcadb0ccb1693b4fbe4e6d0792c5&follow=1'>Add columnsize = 0 option to FTS indexJune McEnroe Since we don't use ranking functions and I don't see them being useful, there is no point in having columnsize, which just takes extra space in the database. In my database of approximately 3.5 million events, disabling columnsize saves about 62 MB. The migration unfortunately has to rebuild the entire index to disable it. 2020-01-12Add option for client cert and SASL EXTERNALJune McEnroe 2020-01-12Add Linux.mkJune McEnroe 2020-01-11Fix unscoop dedup window syntaxJune McEnroe 2020-01-11Bump busy timeout to 10sJune McEnroe