mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
BUMP minimum render size for PDF pages
This commit is contained in:
parent
15c904c139
commit
f29c3a4f96
@ -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.
|
||||
|
@ -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()) {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user