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,9 +64,15 @@ ColorDrawBuf loadImage(immutable ubyte[] data, string filename) {
|
||||||
import std.algorithm : endsWith;
|
import std.algorithm : endsWith;
|
||||||
if (filename.endsWith(".xpm")) {
|
if (filename.endsWith(".xpm")) {
|
||||||
import dlangui.graphics.xpm.reader;
|
import dlangui.graphics.xpm.reader;
|
||||||
|
try {
|
||||||
return parseXPM(data);
|
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) {
|
version (USE_DEIMAGE) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
module dlangui.graphics.xpm.reader;
|
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.xpm.colors;
|
||||||
|
|
||||||
import dlangui.graphics.colors;
|
import dlangui.graphics.colors;
|
||||||
|
|
Loading…
Reference in New Issue