summaryrefslogtreecommitdiff
path: root/plugingui
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
parente1ff098df5bfbc7c02a3bf522ffaad2998f0010a (diff)
Store filename with Image for use when reporting errors.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/image.cc5
-rw-r--r--plugingui/image.h1
2 files changed, 5 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;
}
diff --git a/plugingui/image.h b/plugingui/image.h
index ae0e051..e70215e 100644
--- a/plugingui/image.h
+++ b/plugingui/image.h
@@ -60,6 +60,7 @@ private:
std::size_t _height{0};
std::vector<Colour> image_data;
Colour out_of_range{0.0f, 0.0f, 0.0f, 0.0f};
+ std::string filename;
};
} // GUI::