STBI_ONLY_JPEG (#1789)

This commit is contained in:
jomjol
2023-01-11 20:21:14 +01:00
committed by GitHub
parent eefdc74e9a
commit a39092497e
4 changed files with 15 additions and 9 deletions

View File

@@ -123,8 +123,12 @@ void CAlignAndCutImage::CutAndSave(std::string _template1, int x1, int y1, int d
p_target[_channels] = p_source[_channels];
}
// stbi_write_jpg(_template1.c_str(), dx, dy, channels, odata, 0);
#ifdef STBI_ONLY_JPEG
stbi_write_jpg(_template1.c_str(), dx, dy, channels, odata, 100);
#else
stbi_write_bmp(_template1.c_str(), dx, dy, channels, odata);
#endif
RGBImageRelease();

View File

@@ -503,11 +503,13 @@ void CImageBasis::SaveToFile(std::string _imageout)
{
stbi_write_jpg(_imageout.c_str(), width, height, channels, rgb_image, 0);
}
#ifndef STBI_ONLY_JPEG
if ((typ == "bmp") || (typ == "BMP"))
{
stbi_write_bmp(_imageout.c_str(), width, height, channels, rgb_image);
}
#endif
RGBImageRelease();
}