Skip to content

Commit

Permalink
Changed files version and minor changes on image_handler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sca075 committed Nov 17, 2024
1 parent 6392580 commit 8deccc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Hypfer Image Handler Class.
It returns the PIL PNG image frame relative to the Map Data extrapolated from the vacuum json.
It also returns calibration, rooms data to the card and other images information to the camera.
Version: 2024.10.0
Version: 2024.11.1
"""

from __future__ import annotations
Expand Down Expand Up @@ -298,7 +298,7 @@ async def async_get_image_from_json(
else:
_LOGGER.debug(f"{self.file_name}: Frame Completed.")
return pil_img
except RuntimeError or RuntimeWarning as e:
except (RuntimeError, RuntimeWarning) as e:
_LOGGER.warning(
f"{self.file_name}: Error {e} during image creation.",
exc_info=True,
Expand Down Expand Up @@ -375,8 +375,13 @@ async def async_map_coordinates_offset(
:param hsf: Height scale factor.
:param width: Width of the image.
:param height: Height of the image.
:return: A tuple containing the adjusted (width, height) values
:raises ValueError: If any input parameters are negative
"""

if any(x < 0 for x in (wsf, hsf, width, height)):
raise ValueError("All parameters must be positive integers")

if wsf == 1 and hsf == 1:
self.imu.set_image_offset_ratio_1_1(width, height)
elif wsf == 2 and hsf == 1:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Image Draw Class for Valetudo Rand256 Image Handling.
This class is used to simplify the ImageHandler class.
Version: 2024.10.0
Version: 2024.11.1
"""

from __future__ import annotations
Expand Down

0 comments on commit 8deccc3

Please sign in to comment.