Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions mapadroid/ocr/pogoWindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,12 @@ def __check_close_present(self, filename, identifier, communicator, radiusratio=
origin_logger.error("Screenshot corrupted: {}", e)
return False

cv2.imwrite(os.path.join(self.temp_dir_path,
str(identifier) + '_exitcircle.jpg'), image)
imwrite_status = cv2.imwrite(os.path.join(self.temp_dir_path,
str(identifier) + '_exitcircle.jpg'), image)
if not imwrite_status:
origin_logger.error("Could not save file: {} - check permissions and path",
os.path.join(self.temp_dir_path, str(identifier) + '_exitcircle.jpg'))
return False

if self.__read_circle_count(os.path.join(self.temp_dir_path, str(identifier) + '_exitcircle.jpg'),
identifier,
Expand Down Expand Up @@ -428,7 +432,10 @@ def __internal_get_inventory_text(self, filename, identifier, x1, x2, y1, y2) ->

# resize image
gray = cv2.resize(gray, dim, interpolation=cv2.INTER_AREA)
cv2.imwrite(temp_path_item, gray)
imwrite_status = cv2.imwrite(temp_path_item, gray)
if not imwrite_status:
origin_logger.error("Could not save file: {} - check permissions and path", temp_path_item)
return None
try:
with Image.open(temp_path_item) as im:
try:
Expand Down