summaryrefslogtreecommitdiff
path: root/gfx/image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/image.cpp')
-rw-r--r--gfx/image.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gfx/image.cpp b/gfx/image.cpp
index 41c59a2..e3e3b01 100644
--- a/gfx/image.cpp
+++ b/gfx/image.cpp
@@ -6,7 +6,11 @@
Image::Image(const char * fileName, int flags) : width {}, height {}, numComponents {}
{
stbi_set_flip_vertically_on_load(1);
- unsigned char * bytes = stbi_load(fileName, &width, &height, &numComponents, flags);
+ int w, h, nc;
+ unsigned char * bytes = stbi_load(fileName, &w, &h, &nc, flags);
+ width = static_cast<unsigned int>(w);
+ height = static_cast<unsigned int>(h);
+ numComponents = static_cast<unsigned int>(nc);
if (!bytes) {
throw std::runtime_error {std::string {"Unable to load image: "} + fileName};