-
Notifications
You must be signed in to change notification settings - Fork 6
Description
While reading over the code of this crate, I noticed that all working dimensions use u16. But I can use ImageMagick to create very wide g4 compressed tiff files (more than 2^16 pixels wide). Being able to decode and encode these (through the image-tiff crate) would require increasing the width and height parameters for all types in this crate to at least u32...
Reading over the spec for Group 4 decoding, I don't see any reference to image size limits.
Both TIFF and PDF specs, as far as I can tell, support 32 bit image dimensions. (TIFF 6.0 permits an ImageWidth with LONG field type, with value up to 2^32-1; and the PDF integer size limit is by convention 2^31-1 (per Annex C of the PDF 1.7 spec.)
Using usize or u64 instead would also be OK, but possibly overkill. (Many image formats and format libraries libraries already impose a <= u32::MAX dimension limit; there is BigTIFF which might be able to go larger, but I haven't confirmed this.)
This would unfortunately be an API breaking change.