mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 04:26:58 +03:00
STBI_ONLY_JPEG (#1789)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user