Skip to content

Commit

Permalink
Fix PNG bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy Sudarsono authored and Billy Sudarsono committed Aug 27, 2023
1 parent da38a3f commit 0e3dfa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gerobug_dashboard/gerocert/gerocert.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def create_cert(name: str, certificate: str, severity):
# VALIDATE FORMAT
file_mime_type = magic.from_file(signature_path, mime=True)
if file_mime_type == "image/png":
if SIGNATURE.mode is not 'RGBA':
if SIGNATURE.mode != 'RGBA':
SIGNATURE.convert("RGBA")
img.paste(SIGNATURE, (int(x_name-10), int(y_name-(SIGNATURE.height+50))), mask=SIGNATURE)
elif file_mime_type == "image/jpeg" or file_mime_type == "image/jpg":
Expand All @@ -103,7 +103,7 @@ def create_cert(name: str, certificate: str, severity):
# VALIDATE FORMAT
file_mime_type = magic.from_file(logo_path, mime=True)
if file_mime_type == "image/png":
if LOGO.mode is not 'RGBA':
if LOGO.mode != 'RGBA':
LOGO.convert("RGBA")
img.paste(LOGO, (int(image_width / 17), int(y_name-215)), mask=LOGO)
elif file_mime_type == "image/jpeg" or file_mime_type == "image/jpg":
Expand Down

0 comments on commit 0e3dfa2

Please sign in to comment.