about summary refs log tree commit diff homepage
path: root/png.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-07 01:11:20 -0500
committerJune McEnroe <june@causal.agency>2019-01-07 01:11:20 -0500
commitb9551af817e9a2ba90289d9c7de0e4a34f92287d (patch)
tree53f6c362880a641d028dba50d53a5959e9cd9b96 /png.h
parentmadvise MADV_NOCORE in image (diff)
downloadtorus-b9551af817e9a2ba90289d9c7de0e4a34f92287d.tar.gz
torus-b9551af817e9a2ba90289d9c7de0e4a34f92287d.zip
Compress PNG data in image
kcgi never enables compression for FastCGI.
Diffstat (limited to 'png.h')
-rw-r--r--png.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/png.h b/png.h
index 4eb4da1..56ddb01 100644
--- a/png.h
+++ b/png.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018  Curtis McEnroe <june@causal.agency>
+/* Copyright (C) 2018, 2019  C. McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -102,6 +102,12 @@ static inline void pngData(FILE *file, const uint8_t *data, uint32_t len) {
 	pngInt32(file, ~pngCRC);
 }
 
+static inline void pngDeflated(FILE *file, const uint8_t *data, uint32_t len) {
+	pngChunk(file, "IDAT", len);
+	pngWrite(file, data, len);
+	pngInt32(file, ~pngCRC);
+}
+
 static inline void pngTail(FILE *file) {
 	pngChunk(file, "IEND", 0);
 	pngInt32(file, ~pngCRC);