Ticket #197 (Open)Fri Jan 23 17:31:30 UTC 2009
PDriverDP resolution limits
Reported by: | Martin Wuerthner (146) | Severity: | Normal |
Part: | RISC OS: Module | Release: | |
Milestone: | Status | Open |
Details by Martin Wuerthner (146):
PDriverDP does not cope with resolutions like 2880 or even 5760 dpi, which are commonplace with current printers. The coordinate computations overflow, e.g., when computing the required size of the memory buffers leading to the nonsensical error “The area reserved for relocatable modules is full” or simply “Out of memory”. The maximum for an A4 page is about 2550dpi vertical resolution.
The first obvious mistake is in PDriverDP.PageBox when computing the number of rows to be printed. The multiplication of the height of the printable area in millipoints by the vertical resolution overflows for an A4 page at 2880 dpi. There are probably more errors like this later on, but the code fails immediately when trying to allocate the computed amount of memory.
This particular instance can be fixed easily even without having to use 64-bit maths by simply diving both the millipoint division factor (r6 = 72000) and the vertical resolution by any common factor (their greatest common divider, or, more easily, by the highest power of 2 they both have in common, i.e., while both are even shift both right). That gives an extra range of up to a factor of 64 (at least 32 with any commonplace resolution larger than 2000dpi, i.e., 2400 or 2880 dpi).
Changelog:
Modified by Martin Wuerthner (146) Fri, January 23 2009 - 17:33:15 GMT
Note: The same bug is there in the ROL branch (tested on current RO6).