Member
Member
MarcelSpijker   2008-08-11, 15:25
#1

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.

Administrator
Administrator
acrylian   2008-08-12, 15:23
#2

A link has been added on our zenphoto plugins page.

Member
Member
sbillard   2008-08-12, 21:57
#3

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.

Administrator
Administrator
acrylian   2008-08-13, 08:01
#4

Also you could consider simply adding the album name to the image file names to avoild name conflicts (for example albumname_imagename.jpg).

Member
Member
jlang   2008-08-14, 09:45
#5

As a suggestion, you could use the same cache folder that the resized and thumbnail images use.

Member
Member
MarcelSpijker   2008-08-15, 18:40
#6

Thanks for the replays! I will update the plugin as soon as possible and let it know here.

Member
Member
MarcelSpijker   2008-08-16, 19:46
#7

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!

Member
Member
sbillard   2008-08-16, 20:13
#8

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.

Member
Member
code   2008-08-17, 06:04
#9

I just updated to 1.2 and downloaded the plugin...

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

Member
Member
krainbolt   2008-08-17, 08:32
#10

Your PHP memory is set to low. You'll need to change "memory_limit" in your php.ini file to a larger value.

Member
Member
code   2008-08-17, 19:21
#11

thanks!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.