Last time I expressed an intent to work on ART image format but the software got in the way. As mentioned earlier, I had to update OS because new browser builds were no longer running on what I had (because it required a newer libstdc++ version that the system offered and I was too stupid to pin the version I had and it was too late to downgrade…). And what do you know, my opinion about Wayland got much worse.
To clarify things a bit, I was rather indifferent about it—fine, it exists, there are some deficiencies but there are some new approaches, maybe it will work out for the best in the end. After it was the default option for me I consider it to be shit, not that conceptually different from X11 protocol (in shittiness as well) but without decades of work-arounds and fixes that made it rather smooth to use. Drag and drop not working under GNOME was a small annoyance and a sign of much worse things to come. My main machine is over sixteen years old and does not support all OpenGL features some applications believe should be always present, so Flutter-based apps crash and when I tried to use imgui it failed because it requested unsupported GLX configuration. The worst thing though is that X11-based compatibility layer via Xwayland is atrocious: using an ordinary app like urxvt may damage GPU state (so e.g. menu and window decorations get random garbage or are missing, text get random garbage overlaid and so on), using xpdf leads to even worse graphical distortions on the whole screen, and using Ghidra often ended up locking system as it stopped responding to anything. For a while I tried to work around it by running Ghidra in VNC session but it got annoying, partly because twm lacks window close button which Ghidra does not provide by itself for all secondary windows.
So I tried plasma server instead. It was different but it did not improve things much. What’s worse, image viewer I use refused to start there. At least sddm provided an option to run MATE in X11 session, and that configuration works fine.
And while the image viewer I use still works there, it shows the signs of software decay (like spamming the console output with GdkPixbuf warnings, adding more shiny features that only distract me while making workflows I actually care about harder), so I decided to finally write my own image viewer after my tastes.
If you wonder what are my unreasonable demands to an ordinary viewer, they come from the fact that I use it not to just look at photos but often at a sequence of decoded video frames where I often need to jump from one image to another (and not necessarily next/previous one) or hold a key and watch poor man’s animation. So what I need in image viewer is:
- an ability to view images in the first place (it should be obvious but considering what I’ve seen in
lu_term…) - supported formats may not include something complex but it should definitely support BMP, GIF, JPEG, PNM and optionally support LBM and PCX;
- a full list of images in the directory with the ability to jump to any file;
- zooming option with nearest-neighbour scaling (again, usually if I zoom in into image that means I want to see its individual pixels better instead of smooth mess usually offered by such viewers) and preferably with xN and x1/N scaling factors, no fancy 63% scaling modes;
- an ability to actually scroll the zoomed image;
- not too painful viewing of large images (e.g. single image created from QT panorama can easily end up being 20000×8000);
- supporting broken images—I often view binary data by giving it a PGM header, so if I declare too large dimensions the viewer should still display a part of it with real data.
Hopefully it’s nothing conceptually complex though I anticipate some of the things here may give me some troubles (like large image support). An additional factor is that after some research I decided to stick to SDL2 again because GUIs don’t map to Rust nicely anyway and from my old days experience they mostly don’t map to C nicely either. So far I wasted a couple of hours and made a primitive viewer that can list files, display one of them and even zoom in or out. Now I need to add scrolling support both to the file list (that’s where most of the foreseen complications come from) and image area, mouse support and write other image loaders. At least some of that should be fun and the result will be useful for my needs, wherever that may happen.