You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by GitBox <gi...@apache.org> on 2020/12/31 06:19:29 UTC

[GitHub] [pdfbox] IntraCherche edited a comment on pull request #93: Updated comment when rendered image is too large

IntraCherche edited a comment on pull request #93:
URL: https://github.com/apache/pdfbox/pull/93#issuecomment-752859592


   Because the code checks `if ((long) widthPx * (long) heightPx > Integer.MAX_VALUE)` and `widthPx` and `heightPx` are defined as
   
   `int widthPx = (int) Math.max(Math.floor(widthPt * scale), 1);`
   ` int heightPx = (int) Math.max(Math.floor(heightPt * scale), 1);`
   
   But then the error message uses `widthPt` and `heightPt` (not `widthPx` and `heightPx` as in the if check). So if you rewrite the the if check (just to understand) with `widthPt` and `heightPt` instead of `widthPx` and `heightPx`, you get :
   `widthPx * heightPx = widthPt * scale * heightPt * scale` which in turn yields to `widthPt * heightPt * scale * scale ` or `widthPt * heightPt * scale ^ 2` which is the proposed update.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org