Hey all
I'm trying to build a simple plugin to do some stuff off the tags on an image. I started with the no_show example (I know its not supported, but it seemed like a decent starting place for what I wanted to do).
Anyway, I have a plugin that basically looks like:
...
zp_register_filter('image_instantiate', 'some_method');
...
function some_method ($imageObj) {
global $_zp_current_admin_obj, $_zp_loggedin;
$currentUsername = $_zp_current_admin_obj->getUser();
print "Current User: ".$currentUsername."<br />";
print "Current Image: ".$imageObj->getFileName()."<br />";
return $imageObj;
}
At first glance, this looks like it works. On each album page, it prints out the username and filename for each image displayed.
My issue is that, in an album with 2 images, when I specifically open the second image, it has the filename (and other metadata) for the first image in the album.
E.g. if I have an album "foo" with two files:
A.JPG
B.JPG
If I open up the second image at
https://myserver.com/foo/B.JPG
It shows:
Current User: [me]
Current Image: A.JPG
I'm sure this has something to do with my misunderstanding with how image_instantiate works, but can anyone point me in the right direction?
Thanks