Allow asymmetric PDF export resolution#3764
Allow asymmetric PDF export resolution#3764tzjtan wants to merge 2 commits intopython-pillow:masterfrom tzjtan:master
Conversation
Allow PDF exporting resolution to be specified as a tuple too, to get asymmetric DPIs sometimes used by sticker/inkjet printers, e.g 600x1200dpi.
|
Hi. Out of curiosity, why did you close this? |
|
Sorry, this is my first time sending a pull request and many things are confusing to me. |
|
Okay, sure. Well, your tests were only failing on style points. So if not isinstance(resolution,(list,tuple)):
resolution2D = (resolution,resolution)needed a space after the commas - if not isinstance(resolution, (list, tuple)):
resolution2D = (resolution, resolution)I would have also suggested that you talk about width and height resolution, instead of 1D and 2D, unless that's an established convention. The only other things would have been providing a link in the discussion to some documentation showing the need for these different resolutions, and adding a test to https://github.com/python-pillow/Pillow/blob/master/Tests/test_file_pdf.py. |
|
Ok thanks, I have spotted the styling errors and got tests to pass on Travis CI. Please let me know if some things should be done another way in my modified pull request. |
|
This is being attempted again in PR #6961 |
Allow PDF exporting resolution to be specified as a tuple too, to get asymmetric DPIs sometimes used by sticker/inkjet printers, e.g 600x1200dpi.