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
Thanks for the great library.
There seems to be a bug when writing RGB images. The following code does not produce a red image. Not sure if I'm doing something wrong.
Thanks,
#include <tinytiffwriter.h>
int main()
{
int height = 32;
int width = 32;
int numPixels = width * height * 3;
char* imagePixels = new char[numPixels];
for (size_t i = 0; i < numPixels; i += 3)
{
imagePixels[i] = 255;
imagePixels[i + 1] = 0;
imagePixels[i + 2] = 0;
}
TinyTIFFWriterFile* tiff = TinyTIFFWriter_open("test.tif", 24,
TinyTIFFWriterSampleFormat::TinyTIFFWriter_UInt, 0, width, height, TinyTIFFWriterSampleInterpretation::TinyTIFFWriter_RGB);
if (tiff)
{
int success = TinyTIFFWriter_writeImageMultiSample(tiff, imagePixels, TinyTIFFSampleLayout::TinyTIFF_Interleaved, TinyTIFFSampleLayout::TinyTIFF_Planar);
TinyTIFFWriter_close(tiff);
}
return 0;
}
The text was updated successfully, but these errors were encountered:
Hi,
Thanks for the great library.
There seems to be a bug when writing RGB images. The following code does not produce a red image. Not sure if I'm doing something wrong.
Thanks,
The text was updated successfully, but these errors were encountered: