Skip to content

Commit

Permalink
Update vehicle.py (#161)
Browse files Browse the repository at this point in the history
Fails for ID.5 GTX images as it is in incorrect RGB format.

Need to convert the new created image to RGBA so that PIL doe snot fail.
  • Loading branch information
DEVIDTR committed Dec 9, 2023
1 parent a0e6ffa commit 79738e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weconnect/elements/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def updateStatusPicture(self) -> None: # noqa: C901
if warningLightsStatus.warningLights.enabled:
for warningLight in warningLightsStatus.warningLights.values():
if warningLight.icon.enabled:
draw = ImageDraw.Draw(imgWithBadges)
draw = ImageDraw.Draw(imgWithBadges.convert("RGBA"))
draw.ellipse(((imgWidth - 100), warningLightoffset, (imgWidth - 1), (warningLightoffset + 100)), fill=(0, 0, 0, 200))
lightImage = warningLight.icon.value
lightImage = lightImage.resize((64, 64), Image.LANCZOS)
Expand Down

0 comments on commit 79738e9

Please sign in to comment.