michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
309 stars 49 forks source link

Add API to get/set image size limits #224

Closed michaelrsweet closed 1 year ago

michaelrsweet commented 1 year ago

Right now the maximum JPEG/PNG image dimensions are hardcoded at 64kx64k (12GB for the largest RGB image), but embedded platforms like the Raspberry Pi top out at much less and don't typically have swap. We need API for this:

extern void papplSystemGetMaxImageSize(pappl_system_t *system, int *max_width, int *max_height, size_t *max_size) _PAPPL_PUBLIC;
extern void papplSystemSetMaxImageSize(pappl_system_t *system, int max_width, int max_height, size_t max_size) _PAPPL_PUBLIC;

A max value of 0 means "unlimited". The defaults should be 16k for width and height and 64MB for total size.

michaelrsweet commented 1 year ago

Adjusted the get/set APIs slightly:

[master 46e9e43] Add image size APIs (Issue #224)