BUMP minimum render size for PDF pages

This commit is contained in:
Luis Ángel San Martín Rodríguez 2024-06-20 17:12:03 +02:00
parent 15c904c139
commit f29c3a4f96
3 changed files with 10 additions and 4 deletions

View File

@ -7,6 +7,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
### YACReader
* Save magnifying glass size and zoom level.
* Add shortcut to reset the magnifying glass to its defaults (size and zoom), it is `slash` by default but it can be reasigned.
* Bump PDF render size.
###
* Fix headers in the table view getting stuck in a non moveable state.

View File

@ -106,11 +106,16 @@ QImage PdfiumComic::getPage(const int page)
}
// TODO: make target DPI configurable
// TODO: max render size too
QSize pagesize((FPDF_GetPageWidth(pdfpage) / 72) * 150,
(FPDF_GetPageHeight(pdfpage) / 72) * 150);
// TODO: max render size too
if (pagesize.width() > 3840 || pagesize.height() > 3840) {
pagesize.scale(3840, 3840, Qt::KeepAspectRatio);
auto maxSize = 4096;
if (pagesize.width() > maxSize || pagesize.height() > maxSize) {
pagesize.scale(maxSize, maxSize, Qt::KeepAspectRatio);
}
auto minSize = 2560;
if (pagesize.width() < minSize || pagesize.height() < minSize) {
pagesize.scale(minSize, minSize, Qt::KeepAspectRatio);
}
image = QImage(pagesize, QImage::Format_ARGB32); // QImage::Format_RGBX8888);
if (image.isNull()) {

View File

@ -55,7 +55,7 @@ QImage MacOSXPDFComic::getPage(const int pageNum)
// CGPDFPageRef page = [self getPage:page_number];
CGRect pageRect = CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
int width = 1200;
int width = 2560;
// NSLog(@"-----%f",pageRect.size.width);
CGFloat pdfScale = float(width) / pageRect.size.width;