mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 04:07:11 +02:00
Addressing some feedback. Making the .obj.gz checks more specific and adding an exception if gunzip fails.
This commit is contained in:
parent
781e2f409f
commit
f8c30c70e8
1 changed files with 5 additions and 2 deletions
|
@ -175,7 +175,7 @@ void GeometryReader::run() {
|
|||
if (!urlname.isEmpty() && !_url.path().isEmpty() &&
|
||||
(_url.path().toLower().endsWith(".fbx") ||
|
||||
_url.path().toLower().endsWith(".obj") ||
|
||||
_url.path().toLower().endsWith(".gz"))) {
|
||||
_url.path().toLower().endsWith(".obj.gz"))) {
|
||||
FBXGeometry::Pointer fbxGeometry;
|
||||
|
||||
if (_url.path().toLower().endsWith(".fbx")) {
|
||||
|
@ -185,11 +185,14 @@ void GeometryReader::run() {
|
|||
}
|
||||
} else if (_url.path().toLower().endsWith(".obj")) {
|
||||
fbxGeometry.reset(OBJReader().readOBJ(_data, _mapping, _combineParts, _url));
|
||||
} else if (_url.path().toLower().endsWith(".gz")) {
|
||||
} else if (_url.path().toLower().endsWith(".obj.gz")) {
|
||||
QByteArray uncompressedData;
|
||||
if (gunzip(_data, uncompressedData)){
|
||||
fbxGeometry.reset(OBJReader().readOBJ(uncompressedData, _mapping, _combineParts, _url));
|
||||
} else {
|
||||
throw QString("failed to decompress .obj.gz" );
|
||||
}
|
||||
|
||||
} else {
|
||||
throw QString("unsupported format");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue