Skip to content

Fails to write 16 bit image with pnm #1687

@Icelk

Description

@Icelk

When trying to write a 16-bit image with the PnmHeader below, I get the error Invalid color type for selected PAM color type

pnm::ArbitraryHeader {
    depth: 3,
    height: image.height(),
    width: image.width(),
    maxval: u16::MAX as u32,
    tupltype: Some(pnm::ArbitraryTuplType::RGB),
}

Taking a look at the source, I see no reason as to why only RGB8 & RGBA8 are allowed.

Expected

This should work.

Reproduction steps

Construct an 16-bit RGB image and then pass it to PnmEncoder::write_image, with the header above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions