stbで読み込む画像がおかしくなることがあるのを修正

This commit is contained in:
lltcggie 2016-02-04 14:21:01 +09:00
parent d348cc9f37
commit f63016d47f

View File

@ -556,7 +556,7 @@ Waifu2x::eWaifu2xError Waifu2x::LoadMat(cv::Mat &float_image, const boost::files
Waifu2x::eWaifu2xError Waifu2x::LoadMatBySTBI(cv::Mat &float_image, const std::vector<char> &img_data) Waifu2x::eWaifu2xError Waifu2x::LoadMatBySTBI(cv::Mat &float_image, const std::vector<char> &img_data)
{ {
int x, y, comp; int x, y, comp;
stbi_uc *data = stbi_load_from_memory((const stbi_uc *)img_data.data(), img_data.size(), &x, &y, &comp, 4); stbi_uc *data = stbi_load_from_memory((const stbi_uc *)img_data.data(), img_data.size(), &x, &y, &comp, 0);
if (!data) if (!data)
return eWaifu2xError_FailedOpenInputFile; return eWaifu2xError_FailedOpenInputFile;