1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0025815: Visualization - emit error message in case of texture loading fail

Added error message in case when texture cannot be loaded from file.
This commit is contained in:
isz 2015-04-15 12:05:11 +03:00 committed by bugmaster
parent 9dfbbfe673
commit 0c015ee26c

View File

@ -23,6 +23,8 @@
#include <Image_AlienPixMap.hxx>
#include <gp.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <OSD_OpenFile.hxx>
@ -262,7 +264,10 @@ bool Image_AlienPixMap::Load (const TCollection_AsciiString& theImagePath)
}
if ((aFIF == FIF_UNKNOWN) || !FreeImage_FIFSupportsReading (aFIF))
{
// unsupported image format
TCollection_AsciiString aMessage = "Error: image file '";
aMessage.AssignCat (theImagePath);
aMessage.AssignCat ("' has unsupported file format.");
::Message::DefaultMessenger()->Send (aMessage, Message_Fail);
return false;
}
@ -285,6 +290,10 @@ bool Image_AlienPixMap::Load (const TCollection_AsciiString& theImagePath)
#endif
if (anImage == NULL)
{
TCollection_AsciiString aMessage = "Error: image file '";
aMessage.AssignCat (theImagePath);
aMessage.AssignCat ("' is missing or invalid.");
::Message::DefaultMessenger()->Send (aMessage, Message_Fail);
return false;
}
@ -294,6 +303,10 @@ bool Image_AlienPixMap::Load (const TCollection_AsciiString& theImagePath)
if (aFormat == Image_PixMap::ImgUNKNOWN)
{
//anImage = FreeImage_ConvertTo24Bits (anImage);
TCollection_AsciiString aMessage = "Error: image file '";
aMessage.AssignCat (theImagePath);
aMessage.AssignCat ("' has unsupported pixel format.");
::Message::DefaultMessenger()->Send (aMessage, Message_Fail);
return false;
}