📜 ⬆️ ⬇️

PhotoSlider - GPL utility for parsing the rubble of photos

PhotoSlider's goal

I read several photo blogs in which sometimes “photo packs / sessions / reports” appear. Plus, friends carry their photos gigabytes. As soon as there are quite a lot of photos (thousands of 10-20), I look at them leaving only 0.001% of them left on their wallpaper.
Everyone's cameras are getting better, photos are weighing more and more, which can not affect the speed of their loading. There was a problem with how to effectively clean all this. Almost all photos after a single viewing are deleted, a small number of favorites are moved to the wallpaperbox daddy.
Initially, I used either Picasa or FSViewer. But both were not satisfied for some reason.

Having tormented myself, I began to write my own utility, which became PhotoSlider.
Under the cut details of implementation and management.

How to use

Installs no, runs from the console. Understands only 2 parameters:

Recursively scans the current folder (with subfolders), always expanding to full screen. If there is an opportunity to display several photos on the screen (say, if 2 panoramas are vertically mounted on the screen without interfering with each other), several will be shown.
The management is as follows (not configured as unnecessary, at least to me).

How technically implemented

Photos are uploaded in a separate stream. In order not to lose time on scaling when displaying on the screen, all photos are scaled (while maintaining the proportions) for the screen resolution in the same (selected) stream.
A separate stream deals with a combination of photos for the next screen. When a command is received, new photos from the combined screen are shown first (so that the user sees them with the least possible delay) and only then old photos are released / deleted / moved.
In order not to score all the memory there is a limit on the number of photos hanging in the queue (now this is an abstract restriction: the sum of all photos (width * height * 4) <1024 * 1024 * 1024. I want to redo all the restrictions depending on available RAM, but for now there are more interesting things).
It feels like it works much more alive than other viewers (for the purposes described above), but I expected to get more speed. It seems that somewhere there is a bottleneck, but so far it has not been profiled due to the lack of a profiler.
From the observed, but not caught defects:

The last few commits did not check all the functionality, maybe somewhere else something will come out.
All this is written in C # under .NET 3.5. It was often written in pieces and in a hurry, the architecture of the application is very complicated. I hope to somehow get together and bring the code to normal readability. There are no comments for the most part, for the same reason (+ initially did not plan to develop it further “applications for one-two to use”). It was tested only under Windows. Under Mono did not write anything yet, compiled or not - I do not know. Although I am increasingly drawn to ubuntu, maybe in the future I will redo it under mono.
Sources are laid out on Google Code under GPL3.
I hope this utility is useful to someone else besides me.

')

Source: https://habr.com/ru/post/141410/


All Articles