Projet

Général

Profil

0001-misc-double-allowed-size-for-thumbnailing-images-563.patch

Frédéric Péters, 21 février 2022 10:01

Télécharger (1,26 ko)

Voir les différences:

Subject: [PATCH] misc: double allowed size for thumbnailing images (#56305)

 wcs/qommon/misc.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
wcs/qommon/misc.py
36 36

  
37 37
try:
38 38
    from PIL import Image
39

  
40
    # double allowed size, default Pillow limit is  around a quarter
41
    # gigabyte for a 24 bit (3 bpp) image
42
    #   MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 // 4 // 3)
43
    Image.MAX_IMAGE_PIXELS = int(2 * 1024 * 1024 * 1024 // 4 // 3)
39 44
except ImportError:
40 45
    Image = None
41 46

  
......
709 714
    else:
710 715
        fp = open(filepath, 'rb')  # pylint: disable=consider-using-with
711 716
    try:
712
        image = Image.open(fp)
717
        try:
718
            image = Image.open(fp)
719
        except Image.DecompressionBombError:
720
            raise ThumbnailError()
713 721
        try:
714 722
            exif = image._getexif()
715 723
        except Exception:
716
-