Hi
When browsing an album I have a "banner" that contains the album's details (title, tags, description etc.) positioned at the top of the page. This banner uses a custom sized version of the albums thumbnail as a background image.
I have the gallery setup to use watermarks for all of the images, however for the banner I would like to use a background image that does not have a watermark.
Is there a way to retrieve the current albums thumbnail (with a custom size) that does not have a watermark?
Currently I use this code to retrieve the thumbnail:
`getCustomAlbumThumb(1200)`
P.s. I tried to check the documentation on this site (specifically the guides for "template Functions", "functions.php" and "functions-basic.php") but I get a 403 Forbidden error message.
Comments
All "thumb" named image functions should not return a watermark. As far as I can see it is setup correctly. Did you try clearing the cache?
We have to try to reproduce this.
Alternatively you could try:
`getCustomImageURL(1200, null, null, null, null, null, null, true)`
While the doc is not working correctly, you can get the same function information directly from `zp-core/template-functions.php` and the function comments. The doc is generated from these anyway.
I have tried purging the image cache using cachemanager plugin and have also cleared my browser cache.
Currently I have "image thumbnails" in the Zenphoto options set to use watermarks. If I disable this option the banner doesn't have the watermark, however none of the other thumbnails do either. I would really like to override the watermark option just for the banner background instead of disabling the watermarks on all thumbnails.
Initially `getCustomImageURL()` returned nothing. If I set the current image to be the album's thumb using `makeImageCurrent()` and then call `getCustomImageURL()` it returns the album thumb. Unfortunately it still has the watermark. The exact code I used is:
`makeImageCurrent($_zp_current_album->getAlbumThumbImage());`
`getCustomImageURL(1200, NULL, NULL, NULL, NULL, NULL, NULL, TRUE);`
You could try to temporarily reset the option right before the image function calls:
`setOption('Image_watermark', 0, false); // watermark options are named a bit confusingly for unknown reasons… The uppercase "I" is not a typo.`
Then after the images reset it again `setOption('Image_watermark', 1, false);`
`
makeImageCurrent($_zp_current_album->getAlbumThumbImage());
echo $_zp_current_image->webpath;
`
This uses the webpath property of the image object and gets you the webpath to the full image without any watermark.
I echoed the value of "Image_watermark" before and after using the `setOption()` function and the option was set successfully so I'm not sure why the images printed between the two `setOptions()` had the watermark.
The code I used for testing is below ("image thumbnails" in the Zenphoto options is set to use a watermark):
`$defaultWatermark = getOption('Image_watermark');`
`echo 'Global Value: ' . getOption('Image_watermark') . '
';`
`setOption('Image_watermark', 0, false);`
`echo 'New Value: ' . getOption('Image_watermark') . '
';`
`printCustomAlbumThumbImage(NULL, 1000);`
`setOption('Image_watermark', "$defaultWatermark", false);`
`echo '
Reset Value: ' . getOption('Image_watermark') . '
';`
Getting the full image webpath works but some of the images are a bit too large (filesize) to use on the page.
I think I will just leave it as it is. Thank-you very much for your suggestions, I really appreciate the help
Another way would be to:
- Disable watermarks on thumbs globally and keep it enabled on the sized images
- Then the albumthumb would not have one
- If other thumbs should, use the customsize functions instead of thumb functions, It's technically the same image processing as thumb vs sized image is just an internal thing basically.