From 4c6693487b14a5a5ad7f4c5b2a5ed1a7abfdc1ab Mon Sep 17 00:00:00 2001 From: Ben Timby <btimby@gmail.com> Date: Mon, 14 Oct 2024 16:30:34 -0400 Subject: [PATCH 1/2] Allow correct spelling of parameters. --- qrcode/image/styledpil.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qrcode/image/styledpil.py b/qrcode/image/styledpil.py index aa5917a..30f57ce 100644 --- a/qrcode/image/styledpil.py +++ b/qrcode/image/styledpil.py @@ -41,11 +41,18 @@ class StyledPilImage(qrcode.image.base.BaseImageWithDrawer): def __init__(self, *args, **kwargs): self.color_mask = kwargs.get("color_mask", SolidFillColorMask()) - embeded_image_path = kwargs.get("embeded_image_path", None) - self.embeded_image = kwargs.get("embeded_image", None) - self.embeded_image_ratio = kwargs.get("embeded_image_ratio", 0.25) + embeded_image_path = kwargs.get( + "embeded_image_path", + kwargs.get("embedded_image_path", None)) + self.embeded_image = kwargs.get( + "embeded_image", + kwargs.get("embedded_image", None)) + self.embeded_image_ratio = kwargs.get( + "embeded_image_ratio", + kwargs.get("embedded_image_ratio", 0.25)) self.embeded_image_resample = kwargs.get( - "embeded_image_resample", Image.Resampling.LANCZOS + "embeded_image_resample", + kwargs.get("embedded_image_resample", Image.Resampling.LANCZOS) ) if not self.embeded_image and embeded_image_path: self.embeded_image = Image.open(embeded_image_path) From 42ee50e40b702fa98d1b9cf8c368f83e030448d4 Mon Sep 17 00:00:00 2001 From: Ben Timby <btimby@gmail.com> Date: Mon, 14 Oct 2024 16:32:54 -0400 Subject: [PATCH 2/2] Update docs. --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index ec38346..27a0f82 100644 --- a/README.rst +++ b/README.rst @@ -211,7 +211,7 @@ circles by reducing this less than the default of ``Decimal(1)``. The ``StyledPilImage`` additionally accepts an optional ``color_mask`` parameter to change the colors of the QR Code, and an optional -``embeded_image_path`` to embed an image in the center of the code. +``embedded_image_path`` to embed an image in the center of the code. Other color masks: @@ -232,7 +232,7 @@ and an embedded image: img_1 = qr.make_image(image_factory=StyledPilImage, module_drawer=RoundedModuleDrawer()) img_2 = qr.make_image(image_factory=StyledPilImage, color_mask=RadialGradiantColorMask()) - img_3 = qr.make_image(image_factory=StyledPilImage, embeded_image_path="/path/to/image.png") + img_3 = qr.make_image(image_factory=StyledPilImage, embedded_image_path="/path/to/image.png") Examples ========