From f211fc738aa4edf13ba21671a1a23cb81d19c93d Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Mon, 14 Sep 2009 08:58:50 +0000
Subject: [PATCH] Do not call setConversion in _makeDisplayPhoto method, as it
 is not a concern of this method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29019 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Image.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/Document/Image.py b/product/ERP5/Document/Image.py
index 5408ab676a..0639d94646 100644
--- a/product/ERP5/Document/Image.py
+++ b/product/ERP5/Document/Image.py
@@ -397,6 +397,9 @@ class Image(File, OFSImage):
         mime, image = self._makeDisplayPhoto(display, format=format, quality=quality,
                                              resolution=resolution, frame=frame,
                                              image_size=image_size)
+        self.setConversion(image, mime, format=format, quality=quality,
+                           resolution=resolution, frame=frame,
+                           image_size=image_size)
       RESPONSE.setHeader('Content-Type', mime)
       return image.index_html(REQUEST, RESPONSE)
 
@@ -491,10 +494,6 @@ class Image(File, OFSImage):
     image = self._getDisplayPhoto(display, format=format, quality=quality,
                                            resolution=resolution, frame=frame,
                                            image_size=image_size)
-    self.setConversion(image, mime=image.content_type,
-                              display=display, format=format,
-                              quality=quality, resolution=resolution,
-                              frame=frame, image_size=image_size)
     return (image.content_type, aq_base(image))
 
   def _getAspectRatioSize(self, width, height):
-- 
2.30.9