Skip to content

Commit

Permalink
Merge branch '0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn committed May 21, 2013
2 parents 0791101 + ffb54ad commit e4d69b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugins/json/varianttomapconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Tileset *VariantToMapConverter::toTileset(const QVariant &variant)
QString imageSource = variantMap["image"].toString();

if (QDir::isRelativePath(imageSource))
imageSource = mMapDir.path() + QLatin1Char('/') + imageSource;
imageSource = QDir::cleanPath(mMapDir.absoluteFilePath(imageSource));

if (!tileset->loadFromImage(QImage(imageSource), imageSource)) {
mError = tr("Error loading tileset image:\n'%1'").arg(imageSource);
Expand Down Expand Up @@ -363,8 +363,12 @@ ImageLayer *VariantToMapConverter::toImageLayer(const QVariantMap &variantMap)
if (!trans.isEmpty() && QColor::isValidColor(trans))
imageLayer->setTransparentColor(QColor(trans));

const QString imageSource = variantMap["image"].toString();
QString imageSource = variantMap["image"].toString();

if (!imageSource.isEmpty()) {
if (QDir::isRelativePath(imageSource))
imageSource = QDir::cleanPath(mMapDir.absoluteFilePath(imageSource));

if (!imageLayer->loadFromImage(QImage(imageSource), imageSource)) {
// TODO: This error is currently ignored
mError = tr("Error loading image:\n'%1'").arg(imageSource);
Expand Down

0 comments on commit e4d69b5

Please sign in to comment.