Giter Club home page Giter Club logo

Comments (4)

srjfoo avatar srjfoo commented on August 19, 2024

On modern Macs, for those who use a trackpad (tested on a MBP M1, not on a desktop with an external trackpad), control plus one of shift, option or cmd and the two-finger drag, zooming in and out works. control plus the two finger drag is a system default for zooming in on the whole screen, or a portion of the screen as set by the system preferences.

I don't know how easy it would be to implement, but certain applications allow "pinch to zoom". For instance, in this browser window, I am allowed to pinch to zoom within the browser window, and it doesn't affect anything else.

It would also be nice to see the ctrl/cmd plus + and - keyboard shortcuts implemented for zooming in and out.

from guiguts-py.

srjfoo avatar srjfoo commented on August 19, 2024

When testing, I occasionally play with the image resizing currently in place (which is pretty painful on a Mac), and I ponder images in gg2. This time, I actually did some searching, and found https://stackoverflow.com/questions/63787755/dynamic-resizing-of-image-using-pil-and-tkinter. It may ultimately not be of use, but I thought I'd mention it, just in case it is when the time comes.

from guiguts-py.

windymilla avatar windymilla commented on August 19, 2024

Bug discovered by @srjfoo when auto imaging through file:

I brought up gg2 in the footnotes branch (making sure ahead of time that the project actually had some footnotes: the first project I tried didn't). Opened the images. I think I resized the image: I usually do. When I do that, the image area generally comes down to where the scrollbars disappear, because I generally size the image to fit inside the image pane/set the image pane size to be no smaller in either dimension than the image.
When I opened the Footnote results list, the image area was immediately resized to max. The screenshot is designed to show that the image pane essentially doubled in height and width (according to the extra space at the botto.m and the lengths of the scrollbars that weren't there before). Actually, more than doubled. I zoomed out far enough that the scrollbars went away again, and the image is about the size of a postage stamp: about a quarter of the width of the image pane.
If I close footnote fixup, and reopen, the background for the image gets even larger, and at some point, I can't scroll out anymore.

21:35:10: ERROR - root.py:45 - Tkinter Exception
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/__init__.py", line 1967, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "/Users/<username>/dpdev/guiguts-py-3.11/src/guiguts/mainwindow.py", line 373, in wheel_scroll
    self.show_image()
  File "/Users/<username>/dpdev/guiguts-py-3.11/src/guiguts/mainwindow.py", line 345, in show_image
    image.resize(
  File "/Users/<username>/Library/Caches/pypoetry/virtualenvs/guiguts-gE8TiuTD-py3.11/lib/python3.11/site-packages/PIL/Image.py", line 2200, in resize
    return self._new(self.im.resize(size, resample, box))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: height and width must be > 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/__init__.py", line 1967, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "/Users/<username>/dpdev/guiguts-py-3.11/src/guiguts/mainwindow.py", line 345, in show_image
    image.resize(
  File "/Users/<username>/Library/Caches/pypoetry/virtualenvs/guiguts-gE8TiuTD-py3.11/lib/python3.11/site-packages/PIL/Image.py", line 2200, in resize
    return self._new(self.im.resize(size, resample, box))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: height and width must be > 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/__init__.py", line 1967, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "/Users/<username>/dpdev/guiguts-py-3.11/src/guiguts/mainwindow.py", line 345, in show_image
    image.resize(
  File "/Users/<username>/Library/Caches/pypoetry/virtualenvs/guiguts-gE8TiuTD-py3.11/lib/python3.11/site-packages/PIL/Image.py", line 2200, in resize
    return self._new(self.im.resize(size, resample, box))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: height and width must be > 0

from guiguts-py.

srjfoo avatar srjfoo commented on August 19, 2024

Stashing python-image-processing-libraries/ for future reference.

from guiguts-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.