Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2011-10-11 22:43:40 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2011-10-11 22:43:40 (GMT)
commita125f5cd1e930408eb19bd4562c9c0d6fb29d570 (patch)
treefa60ad7013ff1b081cd68ef2b4df05d98c573866
parentdeb187b9d665771683964c76e2f0932d79cc16d3 (diff)
Fix PDF page sizes
We need to use actual image sizes, not the thumbnail sizes.
-rw-r--r--scan.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scan.py b/scan.py
index 8b00de2..cf685c6 100644
--- a/scan.py
+++ b/scan.py
@@ -411,12 +411,13 @@ class ScanThread(threading.Thread):
suffix='.png')
image.save(image_file.name)
image_file.flush()
+ size = image.size
image.thumbnail((1024, 1024))
preview = self._pil_image_to_pixbuf(image)
info = {
'file': image_file,
- 'width_pixel': image.size[0],
- 'height_pixel': image.size[1],
+ 'width_pixel': size[0],
+ 'height_pixel': size[1],
'dpi': self._dpi,
'preview': preview,
}