8423: Python3 needs new_subpixbuf not subpixbuf
This commit is contained in:
parent
c136791a00
commit
e80445127f
@ -90,10 +90,7 @@ def resize_to_jpeg(source, destination, width, height, crop=None):
|
||||
(start_x, start_y, end_x, end_y
|
||||
) = crop_percentage_to_pixel(
|
||||
img.get_width(), img.get_height(), crop)
|
||||
if sys.version_info[0] < 3:
|
||||
img = img.new_subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
else:
|
||||
img = img.subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
img = img.new_subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
|
||||
# Need to keep the ratio intact, otherwise scaled images look stretched
|
||||
# if the dimensions aren't close in size
|
||||
@ -231,10 +228,7 @@ def resize_to_buffer(source, size, crop=None):
|
||||
(start_x, start_y, end_x, end_y
|
||||
) = crop_percentage_to_pixel(
|
||||
img.get_width(), img.get_height(), crop)
|
||||
if sys.version_info[0] < 3:
|
||||
img = img.new_subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
else:
|
||||
img = img.subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
img = img.new_subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
|
||||
# Need to keep the ratio intact, otherwise scaled images look stretched
|
||||
# if the dimensions aren't close in size
|
||||
@ -272,10 +266,7 @@ def resize_to_jpeg_buffer(source, size, crop=None):
|
||||
) = crop_percentage_to_pixel(
|
||||
img.get_width(), img.get_height(), crop)
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
img = img.new_subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
else:
|
||||
img = img.subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
img = img.new_subpixbuf(start_x, start_y, end_x-start_x, end_y-start_y)
|
||||
|
||||
# Need to keep the ratio intact, otherwise scaled images look stretched
|
||||
# if the dimensions aren't close in size
|
||||
|
Loading…
Reference in New Issue
Block a user