On 02/12/2014 09:57 AM, Aline Manera wrote:
On 02/11/2014 03:39 PM, Rodrigo Trujillo wrote:
> The module vmscreenshot is preventing this error using Image.load
> function inside a try/except. However right after the except block,
> the code calls Image.thumbnail() function, which calls the same
> load() function internally. Then the error could happen again.
> This patch fixes this possible problem.
Which error?
I remembered Royce added im.load() to fix a problem in POWER machines
Take a look at: git show 5831b4de
Got explanation from Daniel.
Reviewed-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
> Signed-off-by: Rodrigo Trujillo
<rodrigo.trujillo(a)linux.vnet.ibm.com>
> ---
> src/kimchi/screenshot.py | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/kimchi/screenshot.py b/src/kimchi/screenshot.py
> index 5cfea96..91c14a6 100644
> --- a/src/kimchi/screenshot.py
> +++ b/src/kimchi/screenshot.py
> @@ -177,10 +177,9 @@ class VMScreenshot(object):
> try:
> # Prevent Image lib from lazy load,
> # work around pic truncate validation in thumbnail
> generation
> - im.load()
> + im.thumbnail(self.THUMBNAIL_SIZE)
> except Exception as e:
> kimchi_log.warning("Image load with warning: %s." % e)
> - im.thumbnail(self.THUMBNAIL_SIZE)
> im.save(thumbnail, "PNG")
>
> self.info['thumbnail'] = thumbnail
_______________________________________________
Kimchi-devel mailing list
Kimchi-devel(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel