Commit bd35069df7afb29283fc529c9af8134fd2821c2e
1 parent
51bb9ca5
Make sure a file exists before trying to open it with a load/store
Showing
1 changed file
with
3 additions
and
1 deletions
openbr/openbr_plugin.cpp
| ... | ... | @@ -1479,7 +1479,9 @@ Transform *Transform::make(QString str, QObject *parent) |
| 1479 | 1479 | return make(str.mid(1, str.size()-2), parent); |
| 1480 | 1480 | |
| 1481 | 1481 | // Base name not found? Try constructing it via LoadStore |
| 1482 | - if (!Factory<Transform>::names().contains(parsed.suffix())) { | |
| 1482 | + if (!Factory<Transform>::names().contains(parsed.suffix()) | |
| 1483 | + && (QFileInfo(parsed.suffix()).exists() | |
| 1484 | + || QFileInfo(Globals->sdkPath + "/share/openbr/models/transforms/"+parsed.suffix()).exists())) { | |
| 1483 | 1485 | Transform *tform = make("<"+parsed.suffix()+">", parent); |
| 1484 | 1486 | applyAdditionalProperties(parsed, tform); |
| 1485 | 1487 | return tform; | ... | ... |