Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit 1f0f1a2ad70092b57c44e105e2eb41889a5c7e1f

Fix PDF page sizes

Integer precision isn't enough for inch units; use float instead.
scan.py
(6 / 2)
  
713713 file_idx = self._MODEL_COLUMNS_MAP['file']
714714
715715 max_width_inch = reduce(max,
716 [row[width_idx] / row[dpi_idx] for row in self._images_model])
716 [float(row[width_idx]) / row[dpi_idx]
717 for row in self._images_model])
717718 max_height_inch = reduce(max,
718 [row[height_idx] / row[dpi_idx] for row in self._images_model])
719 [float(row[height_idx]) / row[dpi_idx]
720 for row in self._images_model])
721 logging.debug('max_width_inch=%(max_width_inch).2f,'
722 ' max_height_inch=%(max_height_inch).2f', locals())
719723 canvas = reportlab.pdfgen.canvas.Canvas(f,
720724 pagesize=(max_width_inch*units.inch, max_height_inch*units.inch))
721725