#7083 closed defect (fixed)
PDF pagesize limit : incorrect test
Reported by: | bugbuster | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.2.3 |
Component: | default | Version: | 2.2.1 |
Severity: | normal | Keywords: | |
Cc: |
Description
It seems to me the correction made by #5412 is not sufficient.
In pdfcreatecopy.cpp, the default DPI is modified whenever the image width (resp. height) is larger than MAXIMUM_SIZE_UNIT (i.e. the max size supported by Acrobat). In such case, we take :
dfDPI =(int) (0.5 + nWidth / MAXIMUM_SIZE_UNIT /USER_UNIT_IN_INCH)
In the above formula, we should not take the closest integer, but the upper integer.
As an example, I have an 25808 X 15000 image which is converted to PDF. The PDF plugin adjusts the DPI to 129 (see DEBUG log) :
dfDPI = (int)(0.5 + 25808 / 14400 * 72) = (int)(0.5 + 129.04) = 129
I do have an error when opennig the image with Acrobat Reader.
I attached a proposed patch where I replaced 0.5 by 1.0.
Attachments (1)
Change History (4)
by , 7 years ago
Attachment: | pdfcreatecopy.cpp.patch added |
---|
comment:3 by , 7 years ago
Milestone: | → 2.2.3 |
---|
Note:
See TracTickets
for help on using tickets.
Proposed patch