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.
- Picasa does not want to show the photo in full screen, you can not delete it by pressing one button (for each photo it asks for confirmation), switching to the next photo is rather slow (in the case of viewing ~ 24 MP photos on the laptop is very unpleasant);
- FSViewer also did not differ much in speed, with better removal, but still slow. In addition, he still does not understand unicode in file names (he has long asked developers to add support).
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:
- as - run on all monitors
- --movepath [path] - where the favorites are moved (by default, the _good daddy is created).
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).
- escape - exit;
- space - show the next batch of photos without doing anything with the current ones;
- del - delete all. Caution, deleted without any requests and past the basket!
- m - move all photos “to favorites”;
- up / down arrows - “add / remove row”. Those. The maximum resolution of the photo vertically is divided by the number of rows. It is convenient to view packs when there are a lot of uninteresting photos;
- left / right arrows - the same, only with rows;
- By clicking the mouse you can see the "full screen" photo, if the number of rows / columns> 0, separately from the other photos. On the right button there is a menu that duplicates the buttons.
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:
- some photos refuse to be loaded, although the same FSViewer opens them without problems. The problem is somewhere inside the Windows functions used by the .NET Framework, it seems;
- sometimes it is impossible to delete certain files. Could not google why not deleted;
- sometimes wrong scaling is obtained if you often play with a change in the number of rows / columns;
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.