mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
exception/error handling
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@137 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -57,15 +57,19 @@ class CardThumbnailRequest : public ThumbnailRequest {
|
||||
, filename(filename)
|
||||
{}
|
||||
virtual Image generate() {
|
||||
ImageCardList* parent = (ImageCardList*)owner;
|
||||
Image image;
|
||||
if (image.LoadFile(*parent->set->openIn(filename))) {
|
||||
// two step anti aliased resampling
|
||||
image.Rescale(36, 28); // step 1: no anti aliassing
|
||||
Image image2(18, 14, false); // step 2: with anti aliassing
|
||||
resample(image, image2);
|
||||
return image2;
|
||||
} else {
|
||||
try {
|
||||
ImageCardList* parent = (ImageCardList*)owner;
|
||||
Image image;
|
||||
if (image.LoadFile(*parent->set->openIn(filename))) {
|
||||
// two step anti aliased resampling
|
||||
image.Rescale(36, 28); // step 1: no anti aliassing
|
||||
Image image2(18, 14, false); // step 2: with anti aliassing
|
||||
resample(image, image2);
|
||||
return image2;
|
||||
} else {
|
||||
return Image();
|
||||
}
|
||||
} catch (...) {
|
||||
return Image();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user