MulimgViewer Development Guide

Join us!

Original Intention: Currently, image browsers on the market cannot display multiple images at the same time. MulimgViewer, born on August 10, 2020, hopes to make it convenient for everyone to display and compare multiple images. Aspiration for a lifetime, hoping to leave a mark in this world.

Positioning: MulimgViewer, which stands for multi-image viewer. The core function of this software is to display and compare multiple images in parallel.

Goal: Hoping that MulimgViewer will reach every corner of the world.

Development: Everyone wishes to customize their own MulimgViewer, but a software that contains various functions may not be liked by everyone. Developing some widely applicable functions will help more people, which is what we hope for. Additionally, enhancing and expanding the core features further is also necessary.

How to participate in development? We sincerely appreciate your joining in the development of MulimgViewer.

Ways to contribute (listed from easiest to hardest):

  1. Project Promotion. Such as: blogs, Twitter, and other social media platforms.

  2. Optimizing README. For example: improving the readability of README, enhancing the introduction of a specific feature.

  3. Packaging for platforms such as Ubuntu and iOS. (This feature is currently managed by @wzy)

  4. Support and maintenance of pip installation method. (This feature is currently managed by @wzy).

  5. Report the bug through an issue, and submit a commit to solve the bug.

  6. Improvement of existing features. For example: optimization of running speed, version update prompt.

  7. Development of new features.

  8. Optimization of architecture.

  9. We look forward to any improvement suggestions from each user!

Development of new features:

  1. If you have any good ideas, please create an issue on Github.

  2. In this issue, we can discuss the implementation details of specific features and record the results of the discussion in the issue.

  3. The normal development process is: fork to your local repository -> create a new branch -> implement the feature -> debug it successfully -> merge it into the main branch.

  4. If you wish to participate deeply and continuously in the development of the project, you can contact me by email (liujiawei18@mails.ucas.ac.cn). I will invite you to develop this software and you will be granted direct access to the project, which will facilitate quick and timely updates to the main branch.

File Description

Project Framework:

MulimgViewer/src/mulimgviewer/
    * font/using                    # 7. Store preset fonts for use in displaying titles.
    * gui
        - about_gui.fbp
        - about_gui.py
        - index_table_gui.fbp
        - index_table_gui.py
        - main_gui.fbp              # 4. Using wxFormBuilder can modify the GUI interface and generate the corresponding main_gui.py file.
        - main_gui.py               # 3. The GUI of main.py
        - path_select_gui.fbp
        - path_select_gui.py
    * images
    * src
        * custom_func
            - main.py               # 11. Interface for User-customized Image Processing Functions.
        - main.py                   # 2. Main file, implementing the main logic functionality (callback functions).
        - data.py                   # 5. Load data.
        - utils_img.py              # 6. Image processing functions.
        - path_select.py            # 8. Choose the path in "Parallel manual" mode.
        - about.py                  # 9. Help.
        - index_table.py            # 10. Text List of images
        - utils.py                  # 11. Other Functions
    - __main__.py.py                # 1. Start

Development Flow

GUI creation

The GUI is created using wxFormBuilder. wxFormBuilder is installed:

  1. window platform can be directly downloaded exe

  2. The linux platform can download .deb, or use .flatpak.

  3. wxFormBuilder: https://github.com/wxFormBuilder/wxFormBuilder

  4. Currently, the version of wxFormBuilder used by MulimgViewer is v3.10.1. Everyone can also use the latest version.

Implementing the callback function of GUI

In order to separate the GUI and functionality implementation, it is not recommended to manually modify the files under the MulimgViewer/src/mulimgviewer/gui path. The specific steps are as follows:

  1. create the GUI file (MulimgViewer/src/mulimgviewer/gui/main.fbp) by using wxFormBuilder

  2. Use the auto-generated code to generate MulimgViewer/src/mulimgviewer/gui/main_gui.py. Simply click on the code generation button in wxFormBuilder’s GUI to generate the .py file.

f19

  1. Modify MulimgViewer/src/mulimgviewer/src/main.py to implement the callback function.

More information about wxpython:

Cross-platform support

All functionalities of MulimgViewer are implemented using Python, which ensures cross-platform compatibility. However, there are differences in the file paths between Windows and Linux. It is strongly discouraged to use D:\ncfey\Desktop\ directly, as it would break cross-platform compatibility. Instead, we highly recommend using:

from pathlib import Path

pathlib usage instructions

Readme | Translation

  • When you raise an issue or decide to contribute to this project, you can add it to todo.md.

  • When you complete a feature, you can add the md description of that feature to the issue. When the next version is released, we will update the docs (which only contain the feature introduction for the latest release version).

  • When you complete a feature, you can add it to acknowledgements.md.

Translation

# 1. edit .md
vim docs/*md.
# 2. generate .po
pip install sphinx sphinx-intl myst-parser sphinxcontrib-eval
cd docs
sphinx-build -b gettext ./ build/gettext
sphinx-intl update -p ./build/gettext -l en
# 3. edit translations
vim locale/en/LC_MESSAGES/*.po
# 4. commit
git add -A
git commit
git push

error: ModuleNotFoundError: No module named ‘mulimgviewer’

fix error: set pythonpath windows powershell:

$env:PYTHONPATH = "path_to_directory_1;path_to_directory_2"
echo $env:PYTHONPATH

Release

Our plan for the next release version can be seen on the projects page.

packaging for Windows

  1. install

pip install wxpython pillow pytest-shutil numpy requests
  1. packaging

cd MulimgViewer

Portable version

pyinstaller -F -w -i ./src/mulimgviewer/mulimgviewer.png --add-data "./src/mulimgviewer/mulimgviewer.png;./src/mulimgviewer/" --add-data "./src/mulimgviewer/font/using;./src/mulimgviewer/font/using" --add-data "./src/mulimgviewer/images/flip_cursor.png;./src/mulimgviewer/images/" MulimgViewer.py

Installation version:

  • Packed in a folder

pyinstaller -D -w -i ./src/mulimgviewer/mulimgviewer.png --add-data "./src/mulimgviewer/mulimgviewer.png;./src/mulimgviewer/" --add-data "./src/mulimgviewer/font/using;./src/mulimgviewer/font/using" --add-data "./src/mulimgviewer/images/flip_cursor.png;./src/mulimgviewer/images/" MulimgViewer.py

packaging for linux/ios/arm

Thanks @wzy. This feature is currently managed by @wzy.

命名

MulimgViewer_3.9.3_win10_amd64_Portable.exe
MulimgViewer_3.9.3_win10_amd64_Setup.exe
MulimgViewer_3.9.3_ubuntu_amd64.deb
MulimgViewer_3.9.3_ios_amd64.ipa

Mirror maintenance

Currently, we support the following two mirrors and the release version needs to be pushed to these two sites: