mirror of
https://github.com/python-escpos/python-escpos
synced 2025-09-13 09:09:58 +00:00
filter for ValueError too in dpi logic
This commit is contained in:

committed by
Patrick Kanzler

parent
8f44ae7480
commit
065f4eb66f
@@ -463,7 +463,7 @@ class Escpos(object):
|
|||||||
"""Printer's DPI resolution."""
|
"""Printer's DPI resolution."""
|
||||||
try:
|
try:
|
||||||
dpi = int(self.profile.profile_data["media"]["dpi"])
|
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.
|
# Calculate the printer's DPI from the width info of the profile.
|
||||||
try:
|
try:
|
||||||
px = self.profile.profile_data["media"]["width"]["pixels"]
|
px = self.profile.profile_data["media"]["width"]["pixels"]
|
||||||
|
Reference in New Issue
Block a user