@@ -332,7 +332,7 @@ choose to resize relative to a given size.
332332
333333 from PIL import Image, ImageOps
334334 size = (100, 150)
335- with Image.open("Tests/images/ hopper.webp") as im:
335+ with Image.open("hopper.webp") as im:
336336 ImageOps.contain(im, size).save("imageops_contain.webp")
337337 ImageOps.cover(im, size).save("imageops_cover.webp")
338338 ImageOps.fit(im, size).save("imageops_fit.webp")
@@ -597,7 +597,7 @@ Drawing PostScript
597597 text_y = page_height - text_height - 50 # Distance from the top of the page
598598
599599 # Load the image
600- image_path = os.path.join("img", " hopper.ppm") # Update this with your image path
600+ image_path = " hopper.ppm" # Update this with your image path
601601 with Image.open(image_path) as im:
602602 # Resize the image if it's too large
603603 im.thumbnail((page_width - 100, page_height // 2))
@@ -690,7 +690,7 @@ Reading from a tar archive
690690
691691 from PIL import Image, TarIO
692692
693- fp = TarIO.TarIO("Tests/images/ hopper.tar", "hopper.jpg")
693+ fp = TarIO.TarIO("hopper.tar", "hopper.jpg")
694694 im = Image.open(fp)
695695
696696
@@ -705,7 +705,6 @@ in the current directory can be saved as JPEGs at reduced quality.
705705 import glob
706706 from PIL import Image
707707
708-
709708 def compress_image(source_path, dest_path):
710709 with Image.open(source_path) as img:
711710 if img.mode != "RGB":
0 commit comments