def resize(self, width, height):
    if (self.image.mode in ['1', 'P']):
        logger.debug('converting image from 8-bit/1-bit palette to 32-bit RGB(A) for resize')
        if (self.image.mode == '1'):
            target_mode = 'RGB'
        else:
            target_mode = None
        self.image = self.image.convert(mode=target_mode)
    size = (int(width), int(height))
    self.image.draft(None, size)
    resample = self.get_resize_filter()
    self.image = self.image.resize(size, resample)
def resize(self, width, height):
    if (self.image.mode in ['1', 'P']):
        logger.debug('converting image from 8-bit/1-bit palette to 32-bit RGB(A) for resize')
        if (self.image.mode == '1'):
            target_mode = 'RGB'
        else:
            target_mode = None
        self.image = self.image.convert(mode=target_mode)
    size = (int(width), int(height))
    self.image.draft(None, size)
    resample = self.get_resize_filter()
    self.image = self.image.resize(size, resample)