Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 912960 | Differences between
and this patch

Collapse All | Expand All

(-)Impressive-0.13.1.old/impressive.py (-14 / +10 lines)
Lines 2076-2082 Link Here
2076
        img = ImageOps.equalize(ImageOps.autocontrast(img))
2076
        img = ImageOps.equalize(ImageOps.autocontrast(img))
2077
        for i in range(self.blur):
2077
        for i in range(self.blur):
2078
            img = img.filter(ImageFilter.BLUR)
2078
            img = img.filter(ImageFilter.BLUR)
2079
        img = img.crop((border, border, img.size[0] - 2 * border, img.size[1] - 2 * border)).resize((self.rx, self.ry), Image.ANTIALIAS)
2079
        img = img.crop((border, border, img.size[0] - 2 * border, img.size[1] - 2 * border)).resize((self.rx, self.ry), Image.Resampling.LANCZOS)
2080
        return img2str(img)
2080
        return img2str(img)
2081
class WipeBrightness1(Wipe):
2081
class WipeBrightness1(Wipe):
2082
    """wipe based on the current slide's brightness"""
2082
    """wipe based on the current slide's brightness"""
Lines 2283-2295 Link Here
2283
        self.index_buffer_capacity = 0
2283
        self.index_buffer_capacity = 0
2284
2284
2285
    def AddCharacter(self, c):
2285
    def AddCharacter(self, c):
2286
        w, h = self.font.getsize(c)
2286
        ox, oy, w, h = self.font.getbbox(c)
2287
        try:
2287
        w += ox
2288
            ox, oy = self.font.getoffset(c)
2288
        h += oy
2289
            w += ox
2290
            h += oy
2291
        except AttributeError:
2292
            pass
2293
        self.line_height = max(self.line_height, h)
2289
        self.line_height = max(self.line_height, h)
2294
        size = (w + 2 * self.feather, h + 2 * self.feather)
2290
        size = (w + 2 * self.feather, h + 2 * self.feather)
2295
        glyph = Image.new('L', size)
2291
        glyph = Image.new('L', size)
Lines 3505-3520 Link Here
3505
    # downsample a supersampled image
3501
    # downsample a supersampled image
3506
    if Supersample and not(ZoomMode):
3502
    if Supersample and not(ZoomMode):
3507
        img = img.resize((int(float(out[0]) / Supersample + 0.5),
3503
        img = img.resize((int(float(out[0]) / Supersample + 0.5),
3508
                          int(float(out[1]) / Supersample + 0.5)), Image.ANTIALIAS)
3504
                          int(float(out[1]) / Supersample + 0.5)), Image.Resampling.LANCZOS)
3509
        parscale = False  # don't scale again
3505
        parscale = False  # don't scale again
3510
3506
3511
    # perform PAR scaling (required for pdftoppm which doesn't support different
3507
    # perform PAR scaling (required for pdftoppm which doesn't support different
3512
    # dpi for horizontal and vertical)
3508
    # dpi for horizontal and vertical)
3513
    if parscale:
3509
    if parscale:
3514
        if PAR > 1.0:
3510
        if PAR > 1.0:
3515
            img = img.resize((int(img.size[0] / PAR + 0.5), img.size[1]), Image.ANTIALIAS)
3511
            img = img.resize((int(img.size[0] / PAR + 0.5), img.size[1]), Image.Resampling.LANCZOS)
3516
        else:
3512
        else:
3517
            img = img.resize((img.size[0], int(img.size[1] * PAR + 0.5)), Image.ANTIALIAS)
3513
            img = img.resize((img.size[0], int(img.size[1] * PAR + 0.5)), Image.Resampling.LANCZOS)
3518
3514
3519
    # crop the overscan (if present)
3515
    # crop the overscan (if present)
3520
    if Overscan:
3516
    if Overscan:
Lines 3567-3573 Link Here
3567
    if newsize > img.size:
3563
    if newsize > img.size:
3568
        filter = Image.BICUBIC
3564
        filter = Image.BICUBIC
3569
    else:
3565
    else:
3570
        filter = Image.ANTIALIAS
3566
        filter = Image.Resampling.LANCZOS
3571
    return img.resize(newsize, filter)
3567
    return img.resize(newsize, filter)
3572
3568
3573
3569
Lines 3703-3709 Link Here
3703
                sy = OverviewCellY - 2 * OverviewBorder
3699
                sy = OverviewCellY - 2 * OverviewBorder
3704
                if HighQualityOverview:
3700
                if HighQualityOverview:
3705
                    t0 = time.time()
3701
                    t0 = time.time()
3706
                    img.thumbnail((sx, sy), Image.ANTIALIAS)
3702
                    img.thumbnail((sx, sy), Image.Resampling.LANCZOS)
3707
                    if (time.time() - t0) > 0.5:
3703
                    if (time.time() - t0) > 0.5:
3708
                        print("Note: Your system seems to be quite slow; falling back to a faster,", file=sys.stderr)
3704
                        print("Note: Your system seems to be quite slow; falling back to a faster,", file=sys.stderr)
3709
                        print("      but slightly lower-quality overview page rendering mode", file=sys.stderr)
3705
                        print("      but slightly lower-quality overview page rendering mode", file=sys.stderr)
Lines 6409-6415 Link Here
6409
        if (dummy.size[0] > maxsize[0]) or (dummy.size[1] > maxsize[1]):
6405
        if (dummy.size[0] > maxsize[0]) or (dummy.size[1] > maxsize[1]):
6410
            size = ZoomToFit(dummy.size, maxsize, force_int=True)
6406
            size = ZoomToFit(dummy.size, maxsize, force_int=True)
6411
            if min(size) > 0:
6407
            if min(size) > 0:
6412
                dummy.thumbnail(size, Image.ANTIALIAS)
6408
                dummy.thumbnail(size, Image.Resampling.LANCZOS)
6413
            else:
6409
            else:
6414
                dummy = None
6410
                dummy = None
6415
        if dummy:
6411
        if dummy:

Return to bug 912960