summaryrefslogtreecommitdiff
path: root/plugingui/image.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-12-02 19:11:34 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-01-21 14:51:32 +0100
commitb2f7b6be4c6695fa741f2eafaef3af5bce5c30c2 (patch)
tree21e0e0e51762849c828d531f6e1fcbba9127010f /plugingui/image.cc
parente1ff098df5bfbc7c02a3bf522ffaad2998f0010a (diff)
Store filename with Image for use when reporting errors.
Diffstat (limited to 'plugingui/image.cc')
-rw-r--r--plugingui/image.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugingui/image.cc b/plugingui/image.cc
index 666170d..ea295b9 100644
--- a/plugingui/image.cc
+++ b/plugingui/image.cc
@@ -45,6 +45,7 @@ Image::Image(const char* data, size_t size)
}
Image::Image(const std::string& filename)
+ : filename(filename)
{
Resource rc(filename);
load(rc.data(), rc.size());
@@ -54,6 +55,7 @@ Image::Image(Image&& other)
: _width(other._width)
, _height(other._height)
, image_data(std::move(other.image_data))
+ , filename(other.filename)
{
other._width = 0;
other._height = 0;
@@ -118,7 +120,8 @@ void Image::load(const char* data, size_t size)
if(res != 0)
{
- ERR(image, "Error in lodepng_decode32: %d", res);
+ ERR(image, "Error in lodepng_decode32: %d while loading '%s'",
+ res, filename.c_str());
setError();
return;
}