fix bug serializing image class

This commit is contained in:
2019-09-03 20:49:34 +02:00
parent 0353d323a4
commit e52b3c98da

View File

@@ -703,6 +703,7 @@ public:
img.comp = 4; img.comp = 4;
img.width = rect.width(); img.width = rect.width();
img.height = rect.height(); img.height = rect.height();
img.size = pixels * 4;
img.data = std::make_unique<uint8_t[]>(pixels * 4); img.data = std::make_unique<uint8_t[]>(pixels * 4);
auto out = reinterpret_cast<glm::u8vec4*>(img.data.get()); auto out = reinterpret_cast<glm::u8vec4*>(img.data.get());
if (grayscale) if (grayscale)