Skip to content

Commit

Permalink
Merge pull request #1255 from edissyum/3.1.1_fix#1_rgba
Browse files Browse the repository at this point in the history
3.1.1
  • Loading branch information
Brich40 authored Jan 17, 2024
2 parents fdd2a35 + 6015751 commit 25ac620
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/backend/classes/Files.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@

def convert_heif_to_jpg(file):
heif_file = pyheif.read(file)
return Image.frombytes(
heif_file = Image.frombytes(
heif_file.mode,
heif_file.size,
heif_file.data,
"raw",
heif_file.mode,
heif_file.stride,
)
heif_file = heif_file.convert('RGB')
return heif_file


class Files:
Expand Down
4 changes: 2 additions & 2 deletions src/backend/process/find_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ def run(self):
if fuzz.ratio(splitted_line[cpt + 1].lower(), name.lower()) >= 80:
firstname = splitted_line[cpt + 1].title()
lastname = splitted_line[cpt + 2].title()
if lastname.lower() in ['de', 'el', 'da', 'le'] and len(splitted_line) >= cpt + 3:
if lastname.lower() in ['de', 'el', 'da', 'le'] and len(splitted_line) > cpt + 3:
lastname += ' ' + splitted_line[cpt + 3].title()
elif fuzz.ratio(splitted_line[cpt + 2].lower(), name.lower()) >= 80 or \
(len(splitted_line) > cpt + 3 and splitted_line[cpt + 3].lower()):
lastname = splitted_line[cpt + 1].title()
if lastname.lower() in ['de', 'el', 'da', 'le'] and len(splitted_line) >= cpt + 3:
if lastname.lower() in ['de', 'el', 'da', 'le'] and len(splitted_line) > cpt + 3:
lastname += ' ' + splitted_line[cpt + 2].title()
firstname = splitted_line[cpt + 3].title()
else:
Expand Down

0 comments on commit 25ac620

Please sign in to comment.