Log exception and return null on xpm loading failure. Add copyright

This commit is contained in:
FreeSlave 2015-06-07 14:34:15 +03:00
parent 3638974bdf
commit c958169f88
2 changed files with 17 additions and 2 deletions

View File

@ -64,8 +64,14 @@ ColorDrawBuf loadImage(immutable ubyte[] data, string filename) {
import std.algorithm : endsWith;
if (filename.endsWith(".xpm")) {
import dlangui.graphics.xpm.reader;
return parseXPM(data);
try {
return parseXPM(data);
}
catch(Exception e) {
Log.e("Failed to load image from file ", filename);
Log.e(to!string(e));
return null;
}
}
version (USE_DEIMAGE) {

View File

@ -1,5 +1,14 @@
module dlangui.graphics.xpm.reader;
/**
* Reading .xpm files.
*
* Copyright: Roman Chistokhodov, 2015
* License: Boost License 1.0
* Authors: Roman Chistokhodov, freeslave93@gmail.com
*
*/
import dlangui.graphics.xpm.colors;
import dlangui.graphics.colors;