Skip to content

Commit

Permalink
Merge pull request #14 from awsr/python10-fix
Browse files Browse the repository at this point in the history
Fix Python 3.10 compatibility
  • Loading branch information
blueaxis authored Jan 2, 2023
2 parents 5a9b6d3 + f4869a5 commit 505b8e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Recommended:

Approximately 250 MB of free space and 200 MB of memory is needed to run the application using the Tesseract API. If using the Manga OCR model, an additional 450 MB of free space and 800 MB of memory is required.

For developers, the following Python versions are supported: 3.7, 3.8, and 3.9.
For developers, the following Python versions are supported: 3.7, 3.8, 3.9, and 3.10.

## Acknowledgements <a name = "acknowledgements"></a>
This project will not be possible without the MangaOcr model by [Maciej Budyś](https://github.com/kha-white) and the Tesseract python wrapper by [sirfz](https://github.com/sirfz) and [the tesserocr contributors](https://github.com/sirfz/tesserocr/graphs/contributors).
Expand Down
14 changes: 7 additions & 7 deletions code/Ribbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def initButtons(self, funcs):

def loadButtonConfig(self, buttonName, buttonConfig):

w = self.parent.frameGeometry().height(
)*config["TBAR_ISIZE_REL"]*buttonConfig["iconW"]
h = self.parent.frameGeometry().height(
)*config["TBAR_ISIZE_REL"]*buttonConfig["iconH"]
m = config["TBAR_ISIZE_MARGIN"]
w = int(self.parent.frameGeometry().height(
)*config["TBAR_ISIZE_REL"]*buttonConfig["iconW"])
h = int(self.parent.frameGeometry().height(
)*config["TBAR_ISIZE_REL"]*buttonConfig["iconH"])
m = int(config["TBAR_ISIZE_MARGIN"])

icon = QIcon()
path = config["TBAR_ICONS"] + buttonConfig["path"]
Expand Down Expand Up @@ -111,8 +111,8 @@ def __init__(self, parent=None, tracker=None):
self.parent = parent
self.tracker = tracker

h = self.parent.frameGeometry().height(
) * config["TBAR_ISIZE_REL"] * config["RBN_HEIGHT"]
h = int(self.parent.frameGeometry().height(
) * config["TBAR_ISIZE_REL"] * config["RBN_HEIGHT"])
self.setFixedHeight(h)

for tabName, tools in config["TBAR_FUNCS"].items():
Expand Down
4 changes: 2 additions & 2 deletions code/Views.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def __init__(self, parent=None, tracker=None):
def viewImage(self, factor=1):
# self.verticalScrollBar().setSliderPosition(0)
factor = self.currentScale
w = factor*self.viewport().geometry().width()
h = factor*self.viewport().geometry().height()
w = int(factor*self.viewport().geometry().width())
h = int(factor*self.viewport().geometry().height())
if self._viewImageMode == 0:
self.pixmap.setPixmap(
self.tracker.pixImage.scaledToWidth(w, Qt.SmoothTransformation))
Expand Down

0 comments on commit 505b8e2

Please sign in to comment.