mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
BUMP minimum render size for PDF pages
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user