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=linksOne 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.
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.
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!
I got this error
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 3888 bytes) in /home/myusername/public_html/zp-core/plugins/histogram.php on line 116