Skip to content

Image resizer failing with "Number of elements in ArrayImg too big" for specific TIFF pixel resolutions #531

@PaavoHelde

Description

@PaavoHelde

Tried to report this at KNIME forum, but there was no feedback, now trying here:

A customer has reported us a problem related to how the pixel resolution is encoded in some TIFF files. In TIFF files the resolutions are specified as rational numbers consisting of a pair of integers. It appears this somehow interferes with the Image Resizer functionality which reports an error: "Execute failed: java.lang.RuntimeException: Number of elements in ArrayImg too big, use for example CellImg instead: 3369802500 > 2147483647".

The issue appears if the TIFFTAG_XRESOLUTION and TIFFTAG_YRESOLUTION resolutions are encoded as 2540155 / 16384 (= 155.03875732421875). This encoding is chosen by libTIFF 4.5.1 for pixel size 64.5 μm. In an earlier libTIFF version (4.1.0) the libTIFF library chose other integers for representing this resolution: 4294967295 / 27702539 (= 155.0387599851407), which are working fine. As the actual resolution values are practically the same, this seems like a bug in the KNIME Image Reader or Image Resizer node.

Image size: 1080x1080, 16 bpp
Image Resizer settings: Linear Interpolation, Affect All Dimensions, Scaling factor 1.2, Image Calibration (customer claims this is needed for next steps).

Demo workspace and demo files attached (one failing, one working; the only difference is the encoding of rational resolutions, changed by a binary editor).

ResizerBug.zip

Any suggestions or workarounds for our customer? (we cannot change the TIFF files easily).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions