From 97c7475007f808aafb1a094ed6349ea7babc20bc Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 24 Jul 2024 06:54:13 +1000 Subject: [PATCH] Improved consistency of example paths --- Tests/images/hopper.webp | Bin 3282 -> 0 bytes docs/handbook/tutorial.rst | 7 +++---- 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 Tests/images/hopper.webp diff --git a/Tests/images/hopper.webp b/Tests/images/hopper.webp deleted file mode 100644 index 1169ab02f4fca8ccdc7cad9647ab3825dd8928e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3282 zcmV;@3@!6gNk&G>3;+OEMM6+kP&gpI3;+O-GXR|dDu4ih06vX8m`9}}qM@!9+~A-Q ziDCfFMnGG>z<#UG9@pLEHWtwIr?Iw*LWN(Rfo8t8*k%hO zcPc~hqu)x;_2hJgrt`Zs%l4^l_b(<@0#uZN?sHMke`BbjQg_t>U#GGUMLHp9#CFK~ zm|aemwQWenF*_YE%6=-b6fNRg|Av-yOks_Eygt<60RH{kBlvBNtPfWsbrs@4H$r#) ze(U+-Mq`*5;{jVW_eC|IV3&Ekyezz-1RG;r@K-_J)G=U9g~?8BdA|4bc`j5Wb?x|} z$B(M*d^if87@m)}`^U3|=;h-aQnRn~!tH_#Uzy$iLHn0uN*=&~zfBG?t@F+1UhsQj z8MKdyrVJQvXZge>xOzn^QUX}y+9v(K^v$b^rqrY+sB*E|i@-8qnD>+}wPm1GnPiJi z^{%`)CjTfb>?rwQ7Tb1gMQMu2JU`i2L)sdom6I+ zSGsz;NhG~PX_ojmcK7YkQ!7kBwB$A;$vPUXIm_#Xh}a1RT>cN9RS(sHvkibOY9DNk zCqCk32K*}a$2Lik>5koSUi0~7BIj>OH#Z4hadr}_wp9(bD9H7emE8M^Y8d{zLVGI$ zs!ojWE9LH(VGTG@{^}bzp-!%YZRW5qit)>Hr-7jg>`+ROjb9Ml9Qy3z?Y)U&{Z@1KrkpV zy4i(u0LjwCg-9dC2yJ4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iiS$>vwtkt@L%Dw@q!+M!<2 zOZ|wpGQ};d1sae>bl^vxSWtBEW$tN8$L?K+os@8)MtGOuoBpyU0A$Avd}g(TnAeko zakMXXMZD5Sz}q@GDefF_0D^NL8YQbRNl(A|^?d381$UrzDX|Mj^&ZG%pf?>Ue>|0q QX4DD&Uki;Vpo-%}0L7JdF8}}l diff --git a/docs/handbook/tutorial.rst b/docs/handbook/tutorial.rst index d8a1ae9c91e..fead6fb21a4 100644 --- a/docs/handbook/tutorial.rst +++ b/docs/handbook/tutorial.rst @@ -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") @@ -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)) @@ -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) @@ -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":