PDF pagesize limit : incorrect test
|Reported by:||bugbuster||Owned by:||warmerdam|
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.