You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This produces the following image on my x86-64 laptop, which is not a single solid gradient as expected:
If I flip the endianness of the image, I get the correct result:
This is likely because encode_file doesn't actually use the type of the array its passed; it just converts it to a u8 array and feeds it straight into the encoder. While that seems like a good idea for making the encoder type agnostic, issues like this combined with the fact that rust doesn't guarentee that fields are stored in the order that they are specified make this a bad idea. Since you depend on the rgb crate anyway, you may as well take pixels using the rgb crate's structures.
The text was updated successfully, but these errors were encountered:
Test program that writes a 16-bit-depth RGBA image containing a gradient:
This produces the following image on my x86-64 laptop, which is not a single solid gradient as expected:
If I flip the endianness of the image, I get the correct result:
This is likely because
encode_file
doesn't actually use the type of the array its passed; it just converts it to au8
array and feeds it straight into the encoder. While that seems like a good idea for making the encoder type agnostic, issues like this combined with the fact that rust doesn't guarentee that fields are stored in the order that they are specified make this a bad idea. Since you depend on the rgb crate anyway, you may as well take pixels using the rgb crate's structures.The text was updated successfully, but these errors were encountered: