I managed to get a working plugin that creates a histogram form the image that is been shown. I got the idea from a Pixelpost plugin called RGBhistogram, actually the calculations are from this plugin. I just molded it to work with Zenphoto.
For who is interested, it can be downloaded here:
http://www.marcelspijker.nl/marcel/zenphoto/?p=links
One bad thing! I still have to make it so that the histogram files are also in subfolders. Have no idea how to do, so any ideas are welcome.
Nice plugin. Some comments:
The plugin does not create the folder for the histograms. You should add
`$folder = SERVERPATH.'/'.getOption('hist_Folder').'/';
if (!file_exists($folder)) {
@mkdir($folder, CHMOD_VALUE);
}`
to the bottom of the script.
The Zenphoto convention is that functions that begin with print actually place the output on the page. Functions that start with get return something that the theme can then place on the page. Your printHistogram() should either be getHistorgram() or it should echo the results.
I think that implementing the subfolders is pretty important. You may get image name collisions otherwise.
Of course, eventually the in-line text needs to be changed to English (where it is not) and enclosed in gettext() calls.
Thanks for the replays! I will update the plugin as soon as possible and let it know here.
I put up a new version of the histogram plugin.
It has a lot of code cleaning inc the gettext() for all of the text.
Also it makes sub folders where it stores the histogram file.
You can download the new version > http://www.marcelspijker.nl/marcel/zenphoto/?p=links/
I have some new ideas to add, like a button in admin panel to clean up the histogram files that are no longer used, and maybe an option with every image to set view/no-view for the histogram file, don't yet know how to do such a thing, bit i will try
Also i don't know how to handle the image/album move options that are now in v1.2 of zenphoto. Would really like to see that the histogram files would also be moved then...
So as you can see i have lots of ideas, but non how to create it, so it is a nice learning project for me
All input is welcome, and again thanks for the great input!
The button in your options is not too hard, just use the custom handling type. You would not be able to add an option for each image without modifying the zp core. So, it depends on how important it is to decide by image about the histogram. Maybe if you just include hiding/showing the histogram in the plugin that would be good enough.