tttppp / mountain_tapir Goto Github PK
View Code? Open in Web Editor NEWMountain Tapir Collage Maker is a tool for combining images into collages.
License: Other
Mountain Tapir Collage Maker is a tool for combining images into collages.
License: Other
It would be useful to have a button to bulk load images into the thumbnail tray at the top. For example being able to multi-select all the photos you want at once, and then be able to place them by clicking.
The photos shouldn't be put into the actual preview pane though. The use-case is more that a user is selecting a palette, and then they want to design their collage.
The swap tool requires two clicks to swap over the images in two regions. It would be nice if the UI displayed something to show that the first click had been made (e.g. a border around the first region or if the region became shaded).
It would be nice to be able to rotate images in regions by 90 degrees.
Expected:
3. The highlighted region stays highlighted and a further click will swap the image with another.
Actual:
3. This doesn't work at all. Further clicks seem to set the region to the first image. For some reason it also sometimes seems impossible to select a different tool.
The existing system file browser dialog is very hard to use, particularly if all the image files are numbered rather than having descriptive names. It would be nice to write a new dialog that displays thumbnails of the image files you are browsing.
For some reason when using snapcraft 2.27 the python scripts from mountain_tapir are not installed into [snap]/lib/python2.7/site-packages/mountain_tapir. This seems to have changed since snapcraft 2.26 (or possibly 2.25).
According to https://insights.ubuntu.com/2017/02/17/snapcraft-2-27-has-been-released/ there has been updates to the python plugin and it can now "detect already staged interpreter instances". I'm not sure whether that is the cause or not though.
It should be fairly easy to workaround the problem by manually updating the prime directory before snapping.
It would be good to add a default extension of ".jpg" if the user doesn't give one. I'm not actually sure what format the images are saved in if you leave the extension blank.
Release 5 (v1.0.2) fails to start with the following error:
Traceback (most recent call last):
File "/snap/mountain-tapir/5/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/snap/mountain-tapir/5/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/snap/mountain-tapir/5/lib/python2.7/site-packages/mountain_tapir/mountain_tapir.py", line 61, in <module>
MountainTapir(root)
File "/snap/mountain-tapir/5/lib/python2.7/site-packages/mountain_tapir/mountain_tapir.py", line 53, in __init__
self.recentImages = RecentImages(self.appContainer, self.controller)
File "/snap/mountain-tapir/5/lib/python2.7/site-packages/mountain_tapir/recent_images.py", line 40, in __init__
self.clearAllButton = TK.Button(self.recentImagesFrame, text='Clear', command=self.clearAll)
File "/snap/mountain-tapir/5/usr/lib/python2.7/lib-tk/Tkinter.py", line 2164, in __init__
Widget.__init__(self, master, 'button', cnf, kw)
File "/snap/mountain-tapir/5/usr/lib/python2.7/lib-tk/Tkinter.py", line 2094, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: failed to allocate font due to internal system font engine problem
I didn't get this when installing the snap locally with --devmode, but I do when installing the downloaded beta channel.
When comparing with the last working version (as in #20) there are plenty of files missing from the beta snap.
Currently the generated documentation mentions flake8, which seems like a good idea! We should fix the style errors.
The default max line length seems archaic, so we should aim for maybe 120 characters instead.
This could be fixed by wrapping the Python 2 and Python 3 classes for file dialogs in a new module.
See http://stackoverflow.com/a/28590707/171296 for details.
sudo easy_install mountain_tapir
Password:
Searching for mountain_tapir
Reading https://pypi.org/simple/mountain_tapir/
Downloading https://files.pythonhosted.org/packages/7b/9f/c1bd8f346759e09b86c6ac5da23c4d9c427c135ad929233353190f0c029c/mountain_tapir-1.1.2-py2.py3-none-any.whl#sha256=f4ac565504ee3c0a757157d4e6cfd8e283d62a728f1a723a7dc934a070dc54e6
Best match: mountain-tapir 1.1.2
Processing mountain_tapir-1.1.2-py2.py3-none-any.whl
Installing mountain_tapir-1.1.2-py2.py3-none-any.whl to /Library/Python/2.7/site-packages
writing requirements to /Library/Python/2.7/site-packages/mountain_tapir-1.1.2-py2.7.egg/EGG-INFO/requires.txt
Adding mountain-tapir 1.1.2 to easy-install.pth file
Installed /Library/Python/2.7/site-packages/mountain_tapir-1.1.2-py2.7.egg
Processing dependencies for mountain_tapir
Searching for Pillow>=4.0.0
Reading https://pypi.org/simple/Pillow/
Downloading https://files.pythonhosted.org/packages/b0/43/3e286c93b9fa20e233d53532cc419b5aad8a468d91065dbef4c846058834/Pillow-9.0.0.tar.gz#sha256=ee6e2963e92762923956fe5d3479b1fdc3b76c83f290aad131a2f98c3df0593e
Best match: Pillow 9.0.0
Processing Pillow-9.0.0.tar.gz
Writing /tmp/easy_install-Zlv8gf/Pillow-9.0.0/setup.cfg
Running Pillow-9.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Zlv8gf/Pillow-9.0.0/egg-dist-tmp-cEER_h
Traceback (most recent call last):
File "/usr/bin/easy_install", line 13, in <module>
load_entry_point('setuptools==41.0.1', 'console_scripts', 'easy_install')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 2319, in main
**kw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 418, in run
self.easy_install(spec, not self.no_deps)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 707, in install_item
self.process_distribution(spec, dist, deps)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 752, in process_distribution
[requirement], self.local_index, self.easy_install
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 253, in run_setup
raise
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 195, in setup_context
yield
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 195, in setup_context
yield
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 44, in _execfile
code = compile(script, filename, 'exec')
File "/tmp/easy_install-Zlv8gf/Pillow-9.0.0/setup.py", line 46
f"Pillow {PILLOW_VERSION} does not support Python "
^
SyntaxError: invalid syntax
We should have a default for values from the properties file, so if it can't be found then there isn't an error.
Currently the frame button does nothing. It should create a rectangle in the middle surrounded by other rectangles. I suggest that the middle rectangle is half the width and height of the overall collage, and that the rectangles around the edge are spread roughly evenly.
If this button is pressed when there are fewer than five regions then it should revert to displaying a grid layout (or the button could be disabled?)
AFAIK, easy_install
is effectively deprecated. I also had some errors due to missing tkinter
and ImageTk
.
Here is what worked for me on Linux Mint 20 (should also work on Ubuntu 20.04):
apt install python3-pip python3-pil.imagetk
pip3 install mountain_tapir
Thanks for your app, it works fine. :)
For example, set the canvas to 600x400 and try to generate a collage with 20 regions in it.
The program should reject generation of a collage with too many regions (as there's a minimum allowed size per region).
When switching between grid, frame and collage it would be nice to keep the same images, but to fill them (at random) into the new arrangement.
It would also be nice to do something similar when adding and removing regions, but that sounds trickier.
The clear recent images button clears all the thumbnails, but does not reset the panel to its original state. The clear button should end up in the middle of the panel, and newly loaded images should then push it to the right.
It would be good to update the properties file when a user changes a configurable property.
It would also be good to support more properties in the file too - e.g. mode, number of regions, output size.
Expected:
3. A grid with 10 regions is generated.
Actual:
3. A grid with 6 regions is generated.
This happens when the perimeter happens to get divided at the very edge of the top/left/right/bottom.
This should be changed to GPL3.
It would be really useful to be able to recentre images within their rectangle. Without the ability to drag, this could be very fiddly.
Just impossible to open an images folder if outside of /home
Ubuntu 18.04
Currently the region images section grows without limit, every time you load a new image. It would be nice to add some sort of paging to this.
Orientation of photos is difficult - many existing applications display some images in different orientations. This is a placeholder ticket to investigate all the different ways in which an image can signal that it's portrait/landscape, and see which can be incorporated in Mountain Tapir.
Sometimes when swapping photos between regions, or when loading an image to replace a populated region, the preview ends up with a weird zoom on the image.
It's possible to workaround this by resizing the application window, which forces a refresh of the preview.
Click to load a new image into a region, then click cancel. There is an unsightly stack trace output.
I don't think there are any other side effects of this, but it should be quick to fix.
For some reason using snapcraft 2.26 does not build a working snap (or this might be a coincidental change - it might be a latest version of something else). When trying to load an image I get the following exception:
Exception in Tkinter callback
Traceback (most recent call last):
File "/snap/mountain-tapir/4/usr/lib/python2.7/lib-tk/Tkinter.py", line 1540, in __call__
return self.func(*args)
File "mountain_tapir/controller.py", line 106, in <lambda>
canvas.bind('<Button-1>',lambda e, c=canvas, r=region: self.clicked(c, r))
File "mountain_tapir/controller.py", line 147, in clicked
self.recentImages.addImage(imageFile, self.selectPlaceTool)
File "mountain_tapir/recent_images.py", line 57, in addImage
imageFile.makeImage('thumbnail', (THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT), imageCellCanvas)
File "mountain_tapir/image_file.py", line 48, in makeImage
photoImage = ImageTk.PhotoImage(image)
File "/snap/mountain-tapir/4/lib/python2.7/site-packages/PIL/ImageTk.py", line 115, in __init__
self.paste(image)
File "/snap/mountain-tapir/4/lib/python2.7/site-packages/PIL/ImageTk.py", line 180, in paste
from PIL import _imagingtk
ImportError: cannot import name _imagingtk
This suggests that something is wrong with PIL. Comparing the prime directory from a working snap (v1.0.1) with a fresh build of the same code I get lots of differences. In particular:
It would be nice to have images rather than text on the buttons. This should make the UI more intuitive, and also hopefully make the interface language-independent.
When increasing the number of regions we should try to keep the existing images in the collage. We should also try to do this when decreasing the number of regions, although obviously we may have to lose one of them.
The issue raised after #16 was fixed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.