diff options
author | Marcos CARDINOT <mcardinot@gmail.com> | 2014-05-05 01:59:39 +0100 |
---|---|---|
committer | Marcos CARDINOT <mcardinot@gmail.com> | 2014-05-05 01:59:39 +0100 |
commit | ab170b1aff8a07aea26bc139ed1bf77f06c95b88 (patch) | |
tree | ea21a2ea8a864d6542f2c124f6c8e5bc2f6d07fd /src/library/coverart.cpp | |
parent | 4806e4420ff865a60e22873ba11d10d76aed1155 (diff) |
fixed bug with saved filename: add ext
Diffstat (limited to 'src/library/coverart.cpp')
-rw-r--r-- | src/library/coverart.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/library/coverart.cpp b/src/library/coverart.cpp index 1298b9eef7..5dcca0e077 100644 --- a/src/library/coverart.cpp +++ b/src/library/coverart.cpp @@ -37,25 +37,28 @@ QString CoverArt::searchCoverArtFile(TrackInfoObject* pTrack) { // Some image extensions QStringList extList; - extList << "jpg" << "jpeg" << "png" << "gif" << "bmp"; + extList << ".jpg" << ".jpeg" << ".png" << ".gif" << ".bmp"; // // Step 1: Look for cover art in cache directory. // foreach (QString ext, extList) { if(QFile::exists(coverArtLocation + ext)) { - return coverArtLocation + "." + ext; + return coverArtLocation + ext; } } + coverArtLocation.append("."); + coverArtLocation.append(defaultImageFormat); // // Step 2: Look for embedded cover art. // QImage image = pTrack->getCoverArt(); + // If the track has embedded cover art, store it if (!image.isNull()) { if(image.save(coverArtLocation, defaultImageFormat)) { - return coverArtLocation + "." + defaultImageFormat; + return coverArtLocation; } } @@ -81,7 +84,7 @@ QString CoverArt::searchCoverArtFile(TrackInfoObject* pTrack) { if (filename.contains(re)) { QImage image(f.absoluteFilePath()); if (image.save(coverArtLocation, defaultImageFormat)) { - return coverArtLocation + "." + defaultImageFormat; + return coverArtLocation; } break; } |