PhotoSlider - GPL utility for parsing photo blockages

PhotoSlider's Goal

I read several photo blogs in which sometimes “photo packs / sessions / reports” slip through. Plus, friends carry their photos in gigabytes. As soon as quite a few types of photographs are collected (thousands of 10-20 each), I look through them leaving a selected 0.001% of them on my wallpaper.
The cameras are getting better for everyone, the photos weigh more and more, which cannot affect the speed of their loading. There was a problem with how to rake it all effectively. Almost all photos after a single view are deleted, a small number of favorites are moved to the folder for wallpaper'ov.
Initially used either Picasa or FSViewer. But both, for some reason, were not happy.
  • Picasa does not want to show the photo in full screen, cannot be deleted by pressing one button (for each photo it asks for confirmation), switching to the next photo is rather slow (when viewing ~ 24 MP the photo 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).

After a little torment, I began to write my own utility, which became PhotoSlider.
Under the cut, implementation and management details.

How to use

There is no installer, it starts from the console. Understands only 2 parameters:
  • as - run on all monitors
  • --movepath [path] - where to move favorites (by default the _good daddy is created).

Recursively scans the current folder (with subfolders), always expands to full screen. If it is possible to display several photos on the screen (for example, if 2 panoramas fit vertically on the screen without interfering with each other), several will be shown.
Management of the following (not configured as unnecessary, at least to me).
  • escape - exit;
  • space - show the next portion of the photo without doing anything with the current;
  • del - delete all. Caution, are 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 divided by the number of rows. It is convenient to view in batches when there are a lot of uninteresting photos;
  • left / right arrows - the same, only with rows;
  • By clicking with the mouse you can see the "full-screen" photo, if the number of rows / columns> 0, separately from the rest of the photo. On the right button there is a menu duplicating the buttons

How technically implemented

Photos are uploaded in a separate stream. In order not to waste time scaling when displayed on the screen, all photos are scaled (with the proportions preserved) to the screen resolution in the same (selected) stream.
A separate stream deals with a combination of photos for the next screen. When a command arrives, new photos are first shown from the combined screen (so that the user sees them with the least possible delay) and only then the old photos are released / deleted / moved.
In order not to clog all the memory, there is a limit on the number of photos hanging in a queue (now this is an abstract restriction: the sum of all photos (width * height * 4) <1024 * 1024 * 1024. I want to redo everything for a limit depending on the available RAM, but for now there are more interesting things).
It feels like it works much livelier than the rest of the viewers (for the purposes described above), but expected to get more speed. It seems that somewhere there is a bottleneck, but has not yet profiled due to the lack of a profiler.
From the noticed, but not caught defects:
  • some photos refuse to load, although the same FSViewer opens them without problems. The problem somewhere inside the windows functions used by the .NET Framework seems to be;
  • sometimes it is not possible to delete certain files. Could not google why not deleted;
  • sometimes incorrect scaling is obtained, if often played 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 application architecture is very confused. I hope I get together somehow and bring the code to normal readability. For the most part, there are no comments, for the same reason (+ initially did not plan to develop it further “to use the application once or twice”). Tested only under Windows. I haven’t written anything under Mono yet; I don’t know if it will compile or not. Although I am more and more attracted to switch to ubuntu, maybe in the future I will remake it under mono.
Sources uploaded to Google Code under GPL3.
I hope this utility is useful to someone else besides me.

Also popular now: