mirror of https://github.com/buggins/dlangui.git
Log exception and return null on xpm loading failure. Add copyright
This commit is contained in:
parent
3638974bdf
commit
c958169f88
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue