Skip to content

Commit

Permalink
Merge pull request #191 from cfcurtis/bug_fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
cfcurtis authored Jul 24, 2023
2 parents 79943f5 + 4fb0579 commit 23520fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion pdfstitcher/ui/main_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,24 @@ def load_file(self, pathname, password=""):
# only enable tiling if there are more than one page
if len(self.in_doc.pages) > 1:
self.tiler = PageTiler()
self.io.do_tile.SetValue(1)
self.io.do_tile.Enable()
self.tt.Enable()

# check how big the pages are, and default to no tiling if they're over A3
first_page = self.in_doc.pages[0]
w, h = utils.get_page_dims(first_page, target_user_unit=1)
if w > 11.7 * 72 or h > 16.5 * 72:
self.io.do_tile.SetValue(0)
else:
self.io.do_tile.SetValue(1)
else:
self.io.do_tile.SetValue(0)
self.io.do_tile.Disable()
self.tt.Disable()

# update the processing description
self.io.on_option_checked(None)

# clear the output if it's already set
self.out_doc_path = None

Expand Down
4 changes: 3 additions & 1 deletion pdfstitcher/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def get_download_url() -> str:
if sys.platform == "win32":
return gh_prefix + "pdfstitcher.exe"
elif sys.platform == "darwin":
return gh_prefix + "PDFStitcher-Installer.dmg"
# for now, just return pdfstitcher.org
# TODO: Determine macOS architecture
return utils.WEB_HOME
else:
return utils.FLATHUB_HOME
2 changes: 1 addition & 1 deletion pdfstitcher/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def get_page_dims(
) -> tuple[float, float]:
"""
Helper function to calculate the page dimensions
Returns width, height as observed by the user
Returns width, height in pixels as observed by the user
(taking rotation and UserUnit into account)
"""
# The mediabox is typically specified as
Expand Down

0 comments on commit 23520fa

Please sign in to comment.