Skip to content

Commit

Permalink
Merge pull request #613 from jdpurcell/memory2
Browse files Browse the repository at this point in the history
Cache memory usage fix (regression due to merge error)
  • Loading branch information
jurplel authored Aug 12, 2023
2 parents 2a6bdfa + 18d49b8 commit 783807d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qvimagecore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,9 @@ void QVImageCore::addToCache(const ReadData &readData)
return;

QString cacheKey = getPixmapCacheKey(readData.absoluteFilePath, readData.fileSize, readData.targetColorSpace);
qint64 pixmapMemoryBytes = static_cast<qint64>(readData.pixmap.width()) * readData.pixmap.height() * readData.pixmap.depth() / 8;

QVImageCore::pixmapCache.insert(cacheKey, new ReadData(readData), readData.fileSize/1024);
QVImageCore::pixmapCache.insert(cacheKey, new ReadData(readData), qMax(pixmapMemoryBytes / 1024, 1LL));
}

QString QVImageCore::getPixmapCacheKey(const QString &absoluteFilePath, const qint64 &fileSize, const QColorSpace &targetColorSpace)
Expand Down

0 comments on commit 783807d

Please sign in to comment.