diff --git a/src/libtomahawk/resolvers/QtScriptResolver.cpp b/src/libtomahawk/resolvers/QtScriptResolver.cpp index b722c1eb5..95b14c070 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.cpp +++ b/src/libtomahawk/resolvers/QtScriptResolver.cpp @@ -333,14 +333,22 @@ QtScriptResolver::init() icoData = qUncompress( QByteArray::fromBase64( icoData ) ); else icoData = QByteArray::fromBase64( icoData ); - bool success = m_icon.loadFromData( icoData ); + QPixmap ico; + ico.loadFromData( icoData ); + + bool success = false; + if ( !ico.isNull() ) + { + m_icon = ico.scaled( m_icon.size(), Qt::IgnoreAspectRatio ); + success = true; + } // load config widget and apply settings loadUi(); QVariantMap config = resolverUserConfig(); fillDataInWidgets( config ); - qDebug() << "JS" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon found" << success; + qDebug() << "JS" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon received" << success; m_ready = true; } diff --git a/src/libtomahawk/resolvers/ScriptResolver.cpp b/src/libtomahawk/resolvers/ScriptResolver.cpp index e977bce4a..95fac1c3b 100644 --- a/src/libtomahawk/resolvers/ScriptResolver.cpp +++ b/src/libtomahawk/resolvers/ScriptResolver.cpp @@ -383,9 +383,17 @@ ScriptResolver::doSetup( const QVariantMap& m ) icoData = qUncompress( QByteArray::fromBase64( icoData ) ); else icoData = QByteArray::fromBase64( icoData ); - bool success = m_icon.loadFromData( icoData ); + QPixmap ico; + ico.loadFromData( icoData ); - qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon found" << success; + bool success = false; + if ( !ico.isNull() ) + { + m_icon = ico.scaled( m_icon.size(), Qt::IgnoreAspectRatio ); + success = true; + } + + qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon received" << success; m_ready = true; m_configSent = false;