Projet

Général

Profil

0001-misc-don-t-crash-if-GraphicsMagick-can-t-thumbnail-a.patch

Frédéric Péters, 22 novembre 2018 09:13

Télécharger (1,02 ko)

Voir les différences:

Subject: [PATCH] misc: don't crash if GraphicsMagick can't thumbnail a PDF
 (28044)

 wcs/qommon/misc.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
wcs/qommon/misc.py
573 573
        raise ThumbnailError()
574 574

  
575 575
    if content_type == 'application/pdf':
576
        fp = StringIO(subprocess.check_output(
577
                ['gm', 'convert', '-geometry', '500x', filepath, 'png:-']))
576
        try:
577
            fp = StringIO(subprocess.check_output(
578
                    ['gm', 'convert', '-geometry', '500x', filepath, 'png:-']))
579
        except subprocess.CalledProcessError:
580
            raise ThumbnailError()
578 581
    else:
579 582
        fp = open(filepath)
580 583

  
581
-