Improved the texture size accuracy when rendering pages using es-pdf-convert

This commit is contained in:
Leon Styhre 2023-06-28 23:06:05 +02:00
parent 1dca0673c5
commit b847b15e07

View file

@ -209,9 +209,8 @@ int main(int argc, char* argv[])
const double pageHeight {pageRect.height()}; const double pageHeight {pageRect.height()};
const double sizeFactor {static_cast<double>(rotate ? height : width) / pageHeight}; const double sizeFactor {static_cast<double>(rotate ? height : width) / pageHeight};
poppler::image image {pageRenderer.render_page( poppler::image image {
page, static_cast<int>(std::round(72.0 * sizeFactor)), pageRenderer.render_page(page, 72.0 * sizeFactor, 72.0 * sizeFactor, 0, 0, width, height)};
static_cast<int>(std::round(72.0 * sizeFactor)), 0, 0, width, height)};
if (!image.is_valid()) { if (!image.is_valid()) {
std::cerr << "Rendered image is invalid" << std::endl; std::cerr << "Rendered image is invalid" << std::endl;