From e0ff65505c79b07f5c3d154bf8c5aa2219a381da Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Sun, 9 Jan 2022 16:15:07 -0500 Subject: [PATCH] Reader: Save RAM when displaying images --- reader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reader.cpp b/reader.cpp index defc850..da51e69 100644 --- a/reader.cpp +++ b/reader.cpp @@ -2032,6 +2032,7 @@ void reader::setupPng() { if(is_pdf == true) { // Note: Output file is supposed to be '/run/page.png', but somehow mutool puts it in '/run/page1.png' QPixmap pixmap("/run/page1.png"); + QFile::remove("/run/page1.png"); // Initialized above graphicsScene->clear(); graphicsScene->addPixmap(pixmap); @@ -2043,6 +2044,7 @@ void reader::setupPng() { } else if(is_image == true) { QPixmap pixmap("/run/image.png"); + QFile::remove("/run/image.png"); // Initialized above graphicsScene->clear(); graphicsScene->addPixmap(pixmap);