Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.0 Beta1
-
None
Description
QImage will happily save an image in correct PPM format with width > 32767, but then fails to load it due to gui/image/qppmhandler.cpp read_pbm_header() :
if (w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0 || mcc > 0xffff)return false; // weird P.M image
There is no mention of maximum dimensions at http://netpbm.sourceforge.net/doc/ppm.html, and the netpbm implementation is much more generous
netpbm-10.73.30/lib/libppm1.c
if (cols > INT_MAX/(sizeof(pixval) * 3) || cols > INT_MAX - 2)
pm_error("image width (%u) too large to be processed", cols);
if (rows > INT_MAX - 2)
pm_error("image height (%u) too large to be processed", rows);
I personally would be grateful for just one greater power of 2