Skip to content

Commit

Permalink
Improved consistency of example paths
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jul 23, 2024
1 parent cf6ec5e commit 97c7475
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Binary file removed Tests/images/hopper.webp
Binary file not shown.
7 changes: 3 additions & 4 deletions docs/handbook/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ choose to resize relative to a given size.

from PIL import Image, ImageOps
size = (100, 150)
with Image.open("Tests/images/hopper.webp") as im:
with Image.open("hopper.webp") as im:
ImageOps.contain(im, size).save("imageops_contain.webp")
ImageOps.cover(im, size).save("imageops_cover.webp")
ImageOps.fit(im, size).save("imageops_fit.webp")
Expand Down Expand Up @@ -597,7 +597,7 @@ Drawing PostScript
text_y = page_height - text_height - 50 # Distance from the top of the page

# Load the image
image_path = os.path.join("img", "hopper.ppm") # Update this with your image path
image_path = "hopper.ppm" # Update this with your image path
with Image.open(image_path) as im:
# Resize the image if it's too large
im.thumbnail((page_width - 100, page_height // 2))
Expand Down Expand Up @@ -690,7 +690,7 @@ Reading from a tar archive

from PIL import Image, TarIO

fp = TarIO.TarIO("Tests/images/hopper.tar", "hopper.jpg")
fp = TarIO.TarIO("hopper.tar", "hopper.jpg")
im = Image.open(fp)


Expand All @@ -705,7 +705,6 @@ in the current directory can be saved as JPEGs at reduced quality.
import glob
from PIL import Image


def compress_image(source_path, dest_path):
with Image.open(source_path) as img:
if img.mode != "RGB":
Expand Down

0 comments on commit 97c7475

Please sign in to comment.