From cfb28074fbad025ba20b7254b3e436d5ea44f812 Mon Sep 17 00:00:00 2001 From: sanj Date: Thu, 29 Jul 2010 01:49:06 +0530 Subject: [PATCH] more playing with dpi --- edgware/editor/models.py | 4 ++-- edgware/editor/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/edgware/editor/models.py b/edgware/editor/models.py index 3f43036..8dab948 100644 --- a/edgware/editor/models.py +++ b/edgware/editor/models.py @@ -231,9 +231,9 @@ class Article(models.Model): def get_print_multiplier(self, dpi): product = Product.objects.get(pk=self.product.id) print_width_mm = product.typ.print_width - dpm = dpi // 25.4 + dpm = dpi / 25.4 pixel_width = print_width_mm * dpm - m = pixel_width // 800.0 + m = pixel_width / 800.0 return m def __unicode__(self): diff --git a/edgware/editor/views.py b/edgware/editor/views.py index 49a1109..66edcd7 100644 --- a/edgware/editor/views.py +++ b/edgware/editor/views.py @@ -579,7 +579,7 @@ def product_pdf(request): def article_pdf(request): a_id = request.GET['id'] article = get_object_or_404_json(Article, pk=a_id) - dpi = request.GET.get('dpi', 150) + dpi = request.GET.get('dpi', 300) width_mm = request.GET.get('width', article.product.typ.print_width) height_mm = int(width_mm // article.product.typ.aspect_ratio) pages = Page.objects.filter(article=article)