Skip to content

Commit 33d8985

Browse files
dc-chengchaoBelval
authored andcommitted
Fix background image resizing
1 parent 8c4d8c1 commit 33d8985

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

TextRecognitionDataGenerator/background_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def picture(height, width):
6363

6464
if pic.size[0] < width:
6565
pic = pic.resize([width, int(pic.size[1] * (width / pic.size[0]))], Image.ANTIALIAS)
66-
elif pic.size[1] < height:
67-
pic.thumbnail([int(pic.size[0] * (height / pic.size[1])), height], Image.ANTIALIAS)
66+
if pic.size[1] < height:
67+
pic = pic.resize([int(pic.size[0] * (height / pic.size[1])), height], Image.ANTIALIAS)
6868

6969
if (pic.size[0] == width):
7070
x = 0

0 commit comments

Comments
 (0)