Skip to content

Commit

Permalink
Cache memory usage fix (regression due to merge error).
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpurcell committed Aug 12, 2023
1 parent 2a6bdfa commit 18d49b8
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 18d49b8

Please sign in to comment.