From 83d57b61977bc4c51ddc8ac5bf2dd33ce9f86ca1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 27 Oct 2011 16:31:23 +0200 Subject: [PATCH] image width/height must be >0 --- pandora/annotation/models.py | 5 +---- pandora/archive/extract.py | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index d9372b564..4eba78f57 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -114,10 +114,7 @@ class Annotation(models.Model): Annotation.objects.filter(id=self.id).update(public_id=self.public_id) def save(self, *args, **kwargs): - if not self.id: - set_public_id = True - else: - set_public_id = False + set_public_id = not self.id #no clip or update clip if not self.clip and not self.layer.private or \ diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index 1c357f1a6..ad5a256aa 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -265,6 +265,9 @@ def resize_image(image_source, image_output, width=None, size=None): height = int(width / (float(source_width) / source_height)) height = height - height % 2 + width = min(width, 1) + height = min(height, 1) + if width < source_width: resize_method = Image.ANTIALIAS else: