-
Notifications
You must be signed in to change notification settings - Fork 687
Closed
Labels
topic: formatsTowards better encoding format coverageTowards better encoding format coverage
Description
Thank you for creating this library and reading my question.
I am obtaining byte data of images from an external API using the reqwest library. Specifically, I am getting the byte data using the .bytes() method.
I then try to use those bytes to save the image or convert the image into a different format (TIFF to PNG) and I get the following error:
Unsupported(UnsupportedError { format: Exact(Tiff), kind: Color(Unknown(1)) })'.
I am using the following code to parse the bytes and obtain the decoded image:
let mut reader = image::io::Reader::with_format(std::io::Cursor::new(response), image::ImageFormat::Tiff);
let img = reader.decode().expect("Could not decode image");
Portion of the byte data received for a particular image:

How do I add the ColorFormat information to bytes data once I have received them? Or is there an alternative way I can still decode the image without the ColorFormat?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
topic: formatsTowards better encoding format coverageTowards better encoding format coverage
Type
Projects
Status
Gif