Archived issue #0025815
Visualization - emit error message in case of texture loading fail
Description
Currently no error message is generated by OCCT visualization in the case if texture used for display of the shape cannot be properly loaded (e.g. due to broken or invalid file). Such message can be output using OCCT messenger mechanism (see Message::DefaultMessenger()).
Steps to reproduce
There is no need for regular test case.
To reproduce issue see attached file.
To reproduce issue see attached file.
Additional information
The problem was discovered due to use of old FreeImage, in test bugs vis bug24376
Public activity
14 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Apr 8 10:17:10 2015 +0300
0025815: Visualization - emit error message in case of texture loading fail
Added error message in case when texture cannot be loaded from file.
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Apr 8 10:17:10 2015 +0300
0025815: Visualization - emit error message in case of texture loading fail
Added error message in case when texture cannot be loaded from file.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Kirill,
Please review branch CR25815.
Please review branch CR25815.
+ if (aCommandName == "vtexture")
+ {
+ TCollection_AsciiString aTextureArg (theArgsNb > 2 ? theArgv[2] : "");
+ if (aTextureArg.Value(1) != '-' && !aTextureArg.IsIntegerValue())
+ {
+ Image_AlienPixMap aPixMap;
+ if (!aPixMap.Load (aTextureArg))
+ {
Draw Harness command is improper way to handle this issue, and additional image loading call will obviously decrease performance without purpose.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Kirill,
Please review branch CR25815.
Please review branch CR25815.
// unsupported image format
+ ::Message::DefaultMessenger()->Send ("Error: unsupported image format!\nSupported file extensions: bmp, ppm, png, jpg, jpe, jpeg, tif, tga, gif, exr.", Message_Fail);
please drop file extensions list and comment before the message.
+ ::Message::DefaultMessenger()->Send ("Error: this file could not be loaded!", Message_Fail);
please include file name into the message
> Error: image file 'FileName' is missing or invalid.
//anImage = FreeImage_ConvertTo24Bits (anImage);
+ ::Message::DefaultMessenger()->Send ("Error: unsupported image format!\nSupported file extensions: bmp, ppm, png, jpg, jpe, jpeg, tif, tga, gif, exr.", Message_Fail);
> Error: image file has unsupported pixel format
-void AIS_TexturedShape::SetTextureFileName (const TCollection_AsciiString& theTextureFileName) +Standard_Boolean AIS_TexturedShape::SetTextureFileName (const TCollection_AsciiString& theTextureFileName)
please drop modifications in AIS_TexturedShape::SetTextureFileName().
+++ b/tests/bugs/vis/bug25815 @@ -0,0 +1,25 @@ +puts "TODO OCC25815 ALL: Error: unsupported image format!\nSupported file extensions: bmp, ppm, png, jpg, jpe, jpeg, tif, tga, gif, exr."
please drop test case simulating failure - tests with TODO are useless.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Kirill,
Please review branch CR25815.
Please review branch CR25815.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Please test the patch.
Dear Commenter 1,
Branch CR25815 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)
products component :
Linux: 4 (4 on master)
Windows: 0 (0 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Test case bug24376 was tested "by hands" - emit error message in case of texture loading fail.
There is no need for regular testing.
Testing on Linux:
occt component :
Total MEMORY difference: 93868590 / 94235765 [-0.39%]
Total CPU difference: 54412.99999999917 / 56192.909999999705 [-3.17%]
products component :
Total MEMORY difference: 23645636 / 23689725 [-0.19%]
Total CPU difference: 17587.04 / 19042.799999999963 [-7.64%]
Testing on Windows:
occt component :
Total MEMORY difference: 57127167 / 57127628 [-0.00%]
Total CPU difference: 15806.629723898948 / 15976.577213298899 [-1.06%]
products component :
Total MEMORY difference: 15476980 / 15478724 [-0.01%]
Total CPU difference: 6294.3751482999705 / 6217.388654799964 [+1.24%]
There are no differences in images found by testdiff.
Branch CR25815 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)
products component :
Linux: 4 (4 on master)
Windows: 0 (0 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Test case bug24376 was tested "by hands" - emit error message in case of texture loading fail.
There is no need for regular testing.
Testing on Linux:
occt component :
Total MEMORY difference: 93868590 / 94235765 [-0.39%]
Total CPU difference: 54412.99999999917 / 56192.909999999705 [-3.17%]
products component :
Total MEMORY difference: 23645636 / 23689725 [-0.19%]
Total CPU difference: 17587.04 / 19042.799999999963 [-7.64%]
Testing on Windows:
occt component :
Total MEMORY difference: 57127167 / 57127628 [-0.00%]
Total CPU difference: 15806.629723898948 / 15976.577213298899 [-1.06%]
products component :
Total MEMORY difference: 15476980 / 15478724 [-0.01%]
Total CPU difference: 6294.3751482999705 / 6217.388654799964 [+1.24%]
There are no differences in images found by testdiff.
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]