Artifact 978a983745e6c3b02647763ad424b79f85355ef439b877a4dc54b91c53337c20:
- File
src/sqlar.h
— part of check-in
[0cc6f109a2]
at
2026-11-20 00:08:59
on branch images
— Images: validate at entry, cap per request, prune by retention
Every image is checked from its header (PNG IHDR with CRC, JPEG frame header, GIF screen, WebP) as Fossil sniffs types: an invalid header, a type that isn't the declared one, more than 8000 px a side or over 4.5 MB is refused; the stored type is the sniffed one, with width and height. RPC image errors are reported, never dropped. A request carries the newest 20 images up to 20 MB; older ones become Pi's placeholder. Image bytes are dropped once compacted away or after imageRetentionDays (default 30; 0 keeps them), leaving hash, type and size and an "[image removed]" placeholder; pic prune [--dry-run] runs it, and it also runs at open at most hourly. pic check re-hashes images. Imports keep images. Journal version 10. (user: dmestas, size: 265) [annotate] [blame] [check-ins using] [more...]
/* SQLite Archive compression as SQL functions (sqlar.c). */ #ifndef PIC_SQLAR_H #define PIC_SQLAR_H #include "sqlite3.h" /* Registers sqlar_compress(X) and sqlar_uncompress(Y, SZ) on db (NULL Y: * NULL). 0 or -1. */ int pic_sqlar_register(sqlite3 *db); #endif