Skip to content

Commit

Permalink
adjust Pillow API to versions > 9.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scgbckbone authored and doc-hex committed Oct 29, 2023
1 parent a586991 commit 42677ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions make_captcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RansomCaptcha(CaptchaMaker):
def draw(self, token, foreground='#000', seed=None):
fn = self.get_font(size=40, which='ransom')
w,h = self.size
dx,dy = fn.getsize('W')
_,_,dx,dy = fn.getbbox('W')

im = Image.new('RGBA', self.size)
dr = ImageDraw.Draw(im)
Expand Down Expand Up @@ -64,7 +64,7 @@ def draw(self, token, foreground='#fff', background='white'):

fn = self.get_font(size=30, which='nova')
w,h = self.size
dx,dy = fn.getsize('W')
_,_,dx,dy = fn.getbbox('W')

randint = self.rng.randint
sample = self.rng.sample
Expand All @@ -74,7 +74,7 @@ def draw(self, token, foreground='#fff', background='white'):
frames = []

ans_y = self.rng.randint(3, h-dy-3)
ans_w = fn.getsize(token)[0]
ans_w = fn.getbbox(token)[2]
count = 15

for fr_num in range(count):
Expand Down

0 comments on commit 42677ec

Please sign in to comment.