From 90c89e66f086577c7184b3e6919415d0e7d72c29 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Fri, 17 Nov 2023 00:33:21 +0100 Subject: [PATCH] filter for ValueError too in dpi logic --- src/escpos/escpos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index f66a13b..c0ab276 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -463,7 +463,7 @@ class Escpos(object): """Printer's DPI resolution.""" try: dpi = int(self.profile.profile_data["media"]["dpi"]) - except (KeyError, TypeError): + except (KeyError, TypeError, ValueError): # Calculate the printer's DPI from the width info of the profile. try: px = self.profile.profile_data["media"]["width"]["pixels"]