summaryrefslogtreecommitdiff
path: root/libpanto/src/cdeps/image_impl.c
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-03 09:11:36 -0600
committert <t@tjp.lol>2026-06-03 12:34:13 -0600
commitac5c4898dfa0a9e57424336774893dfc72b132e9 (patch)
tree03eb8e32a001845dbaec163dfd4905ffc23d9fa6 /libpanto/src/cdeps/image_impl.c
parent2416a308c0e467f8dbdbe09942aa903bca751c0e (diff)
image uploads
Diffstat (limited to 'libpanto/src/cdeps/image_impl.c')
-rw-r--r--libpanto/src/cdeps/image_impl.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libpanto/src/cdeps/image_impl.c b/libpanto/src/cdeps/image_impl.c
new file mode 100644
index 0000000..6266630
--- /dev/null
+++ b/libpanto/src/cdeps/image_impl.c
@@ -0,0 +1,25 @@
+// Single translation unit that compiles the implementations of the
+// vendored single-header image libraries. Keeping the implementation
+// macros confined to one .c file avoids duplicate-symbol errors.
+
+#define STB_IMAGE_IMPLEMENTATION
+// We only decode raster formats we detect via magic bytes. Disable the
+// formats we never feed in to shrink code size and attack surface.
+#define STBI_NO_HDR
+#define STBI_NO_LINEAR
+#define STBI_NO_PSD
+#define STBI_NO_PIC
+#define STBI_NO_PNM
+#define STBI_NO_TGA
+#include "stb_image.h"
+
+#define STB_IMAGE_RESIZE_IMPLEMENTATION
+#include "stb_image_resize2.h"
+
+#define STB_IMAGE_WRITE_IMPLEMENTATION
+#include "stb_image_write.h"
+
+// We feed jebp bytes from memory only; no file I/O needed.
+#define JEBP_NO_STDIO
+#define JEBP_IMPLEMENTATION
+#include "jebp.h"