mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:28:09 +02:00
Fixed importer crashing on non ARGB32 png.
This commit is contained in:
parent
1bc1998023
commit
0068b838b2
1 changed files with 4 additions and 2 deletions
|
@ -1614,8 +1614,10 @@ bool VoxelTree::readFromSquareARGB32Pixels(const char* filename) {
|
||||||
|
|
||||||
QImage pngImage = QImage(filename);
|
QImage pngImage = QImage(filename);
|
||||||
|
|
||||||
for (int x = 0; x < pngImage.width() * pngImage.height(); ++x) {
|
for (int i = 0; i < pngImage.width(); ++i) {
|
||||||
minAlpha = std::min(qAlpha(pngImage.color(x)) , minAlpha);
|
for (int j = 0; j < pngImage.height(); ++j) {
|
||||||
|
minAlpha = std::min(qAlpha(pngImage.pixel(i, j)) , minAlpha);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int maxSize = std::max(pngImage.width(), pngImage.height());
|
int maxSize = std::max(pngImage.width(), pngImage.height());
|
||||||
|
|
Loading…
Reference in a new issue