From b2f7b6be4c6695fa741f2eafaef3af5bce5c30c2 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 2 Dec 2016 19:11:34 +0100 Subject: Store filename with Image for use when reporting errors. --- plugingui/image.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugingui/image.cc') 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; } -- cgit v1.2.3