jcupitt / vipsdisp

Tiny libvips / gtk+4 image viewer
MIT License
143 stars 11 forks source link
gtk4 image image-viewer libvips

vipsdisp

This program displays an image with libvips and gtk4. This is supposed to be a slightly useful image viewer. It can display huge (many, many GB) images quickly and without using much memory. It supports many scientific and technical image formats, including TIFF, WEBP, JP2K, JXL, AVIF, HEIC, PNG, JPEG, SVS, MRXS, OpenEXR, GIF, PDF, SVG, FITS, Matlab, NIfTI, Analyze, etc. It supports pixel types from 1 bit mono to 128-bit double precision complex.

All of the UI can make finding the details of image display in the sourcecode difficult. See vipsdisp-tiny for a minimal example --- that's a libvips image viewer in about 300 lines of very commented C.

Screenshots

It all works, though see the TODO list below.

Screenshot

Screenshot

Screenshot

Screenshot

https://youtu.be/KSoBkO2_HtE

Install

This program is on flathub, see:

https://flathub.org/apps/org.libvips.vipsdisp

Just click "install", or enter:

flatpak install flathub org.libvips.vipsdisp

Features

Shortcuts

Additionally, you can drag and drop filenames, lists of filenames and textures.

Build from source

cd vipsdisp
meson setup build --prefix=~/vips
cd build
ninja
ninja install

And to run:

export GSETTINGS_SCHEMA_DIR=/home/john/vips/share/glib-2.0/schemas
vipsdisp ~/pics/k2.jpg

Version bump checklist

Version needs updating in the following places:

flatpak

Add the flathub repo:

flatpak remote-add --if-not-exists \
  flathub https://flathub.org/repo/flathub.flatpakrepo

Install the gtk4 SDK and runtime:

flatpak install org.gnome.Sdk//47
flatpak install org.gnome.Platform//47

Allow file. Recent security changes to git will cause submodule checkout to fail inside flatpak. If you get errors like fatal: transport 'file' not allowed, re-enable file transport with:

git config --global protocol.file.allow always

Build and try running it:

flatpak-builder --force-clean --user --install build-dir org.libvips.vipsdisp.json
flatpak run org.libvips.vipsdisp ~/pics/k2.jpg

Force a complete redownload and rebuild (should only rarely be necessary) with:

rm -rf .flatpak-builder

Check the files that are in the flatpak you built with:

ls build-dir/files

Uninstall with:

flatpak uninstall vipsdisp

Notes on flatpak build process

Packaging for flathub

Install the appdata checker:

flatpak install flathub org.freedesktop.appstream-glib
flatpak run org.freedesktop.appstream-glib validate org.libvips.vipsdisp.metainfo.xml

Also:

desktop-file-validate org.libvips.vipsdisp.desktop 

Uploading to flathub

Make a PR on:

    https://github.com/flathub/org.libvips.vipsdisp 

then check the build status here:

    https://flathub.org/builds/#/apps/org.libvips.vipsdisp

On success, merge to master.

Build for Windows

Use the libvips Windows build system:

https://github.com/libvips/build-win64-mxe/tree/master

Clone and run:

./build.sh --with-disp all x86_64 shared

TODO