Skip to content

Commit e9a2dd1

Browse files
authored
Update styledpil.py
Fixed typo for StyledPILImage kwarg: embeded -> embedded
1 parent b80fea6 commit e9a2dd1

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

qrcode/image/styledpil.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ class StyledPilImage(qrcode.image.base.BaseImageWithDrawer):
4242

4343
def __init__(self, *args, **kwargs):
4444
self.color_mask = kwargs.get("color_mask", SolidFillColorMask())
45-
embeded_image_path = kwargs.get("embeded_image_path", None)
46-
self.embeded_image = kwargs.get("embeded_image", None)
47-
self.embeded_image_resample = kwargs.get(
48-
"embeded_image_resample", Image.Resampling.LANCZOS
45+
embedded_image_path = kwargs.get("embedded_image_path", None)
46+
self.embedded_image = kwargs.get("embedded_image", None)
47+
self.embedded_image_resample = kwargs.get(
48+
"embedded_image_resample", Image.Resampling.LANCZOS
4949
)
50-
if not self.embeded_image and embeded_image_path:
51-
self.embeded_image = Image.open(embeded_image_path)
50+
if not self.embedded_image and embedded_image_path:
51+
self.embedded_image = Image.open(embedded_image_path)
5252

5353
# the paint_color is the color the module drawer will use to draw upon
5454
# a canvas During the color mask process, pixels that are paint_color
@@ -64,7 +64,7 @@ def new_image(self, **kwargs):
6464
"RGBA"
6565
if (
6666
self.color_mask.has_transparency
67-
or (self.embeded_image and "A" in self.embeded_image.getbands())
67+
or (self.embedded_image and "A" in self.embedded_image.getbands())
6868
)
6969
else "RGB"
7070
)
@@ -79,11 +79,11 @@ def init_new_image(self):
7979

8080
def process(self):
8181
self.color_mask.apply_mask(self._img)
82-
if self.embeded_image:
83-
self.draw_embeded_image()
82+
if self.embedded_image:
83+
self.draw_embedded_image()
8484

85-
def draw_embeded_image(self):
86-
if not self.embeded_image:
85+
def draw_embedded_image(self):
86+
if not self.embedded_image:
8787
return
8888
total_width, _ = self._img.size
8989
total_width = int(total_width)
@@ -94,8 +94,8 @@ def draw_embeded_image(self):
9494
) # round the offset to the nearest module
9595
logo_position = (logo_offset, logo_offset)
9696
logo_width = total_width - logo_offset * 2
97-
region = self.embeded_image
98-
region = region.resize((logo_width, logo_width), self.embeded_image_resample)
97+
region = self.embedded_image
98+
region = region.resize((logo_width, logo_width), self.embedded_image_resample)
9999
if "A" in region.getbands():
100100
self._img.alpha_composite(region, logo_position)
101101
else:

0 commit comments

Comments
 (0)