Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Watermark text in multi root
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=4212
Page 1 of 1

Author:  Faceblind [ 25. Jan 2017, 00:20 ]
Post subject:  Watermark text in multi root

Hi, I'm a new user - I can't see this issue in help or elsewhere on the forums, but please forgive me if I missed it.

I have multi root enabled. I have two independent sets of galleries. In the main one (portrait photos) I have the photos with text and image watermarks. That works absolutely fine.

In the other gallery set, which has photos from gigs I've been to and which I'm happy for people to use, I'd like to have copyright text, but not image watermarks.

I saw in help that I can put a different config.php in each of the different root folders, so I have put one in my 'gigs' folder. It seems to work in that I can stop the watermark image appearing, but in that folder the watermark text also does not appear, despite the config.txt (I think) being configured to display text. This is the appropriate section from the config.php in the folder where I would like watermark text but no image:

This section is responsible for the watermark stuff
*/
$print_text=true; // (true/false) you can print some text on the lower left corner to protect your images or at least make it a little bit harder to copy it without doing anything :) if you change this setting please delete the cache folder - otherwise generated images are not changed.
$print_text_original=true; // (true/false) does print the text on the original as well - $enable_direct_download has to be set to false!!!
$font = dirname(__FILE__) . '/verdana.ttf'; // (String) This are the settings for the image text
$fontsize=10;
$fontsize_original=12;
$text = '(c) Andy Sutton'; // The watermark text.
$textcolor_R = 255; // be careful with changing the colors ! if the compression is low the text becomes unreadable
$textcolor_G = 255; // pretty fast if it is a crazy color :)
$textcolor_B = 255;
$print_watermark = false; // (true/false) you can make a watermark on the images to protect your images or at least make it a little bit harder to copy it without doing anything :) if you change this setting please delete the cache folder - otherwise generated images are not changed. Please read the description of the parameters that belong to the watermark to get best results!
$print_watermark_original=false; // (true/false) does print the watermark on the original as well - $enable_direct_download has to be set to false!!!
$watermark_small = 'buttons/watermark_small.png'; // (String) this is the watermark that is used on the detail and slideshow images - can be jpg or png - png gives better results
$watermark_big = 'buttons/watermark.png'; // (String) this is the watermark that is used on the download images - can be jpg or png - png gives better results. you can use a larger image here because the original images are most of the times much bigger
$position= 7; // (Number) You can define the location of the watermark with this setting (top: 1 2 3, middle: 4 5 6, bottom: 7 8 9
$transparency= 70; // (Number) You can also set the transparency of your logo. 0 is no transparency - 100 max; Try your logo with different settings to get best results. For 24 bit pngs with alphachannel please use 0 because then the alpha transparency is used!
$t_x= 0; // (Number) The next two settings define the position of a transparent color in your watermark.
$t_y= 0; // (Number) If your logo has e.g. a white border you can set the values to 0:0 and the border will be transparent. If you don't want a transparent color: set these values to -1!
/*
Section: Skin Settings



With those settings I would expect to see text but no image. In fact there is no image and no text.

The portrait photo folder doesn't have it's own config.php, but it seems happy to use the main config.php and my_config.php in my main twg24 folder, which I administer with the admin facility.

Many thanks for any help.

Author:  TinyWebGallery [ 25. Jan 2017, 00:28 ]
Post subject:  Re: Watermark text in multi root

Have you cleaned the thumbnail cache?

Author:  Faceblind [ 25. Jan 2017, 00:45 ]
Post subject:  Re: Watermark text in multi root

Thanks for the quick response - yes if you mean clicking the option to clear the image cache in the configuration page - and I look at the dates and times of the cache contents of the cache folder and they are all new after I cleared it. I have tried this many times.

Author:  Faceblind [ 25. Jan 2017, 00:50 ]
Post subject:  Re: Watermark text in multi root

These are the two different galleries:
http://www.faceblind.me/pp/index.html is the main on where there is watermark text and images

http://www.faceblind.me/bandpics/index.html is where I want text but no image, and the config.php lines I've pasted above are in this folder

I've just done "Delete image cache" now.

Author:  TinyWebGallery [ 27. Jan 2017, 01:08 ]
Post subject:  Re: Watermark text in multi root

I have to check on the weekend why this is not working.

Best, Michael

Author:  Faceblind [ 27. Jan 2017, 01:14 ]
Post subject:  Re: Watermark text in multi root

Thank you!

Author:  Faceblind [ 27. Jan 2017, 02:11 ]
Post subject:  Re: Watermark text in multi root

I've solved it!

When I put config.php in some folder I have to alter the line:
include dirname(__FILE__) . '/config_internal.php';
to:
include dirname(__FILE__) . '../../config_internal.php';

which ensures it finds the necessary file, and I also copied the font file specified in the watermark section (verdana.ttf) into the same folder with the config.php file.

There are other __FILE__ pointers in config.php which probably also could be usefully adjusted, but for now I'm happy because I have watermark text before I go to sleep tonight!

Phew!

Author:  TinyWebGallery [ 27. Jan 2017, 10:04 ]
Post subject:  Re: Watermark text in multi root

You should never copy the full main config.php. Actually the config.php in a folder is only the delta! I did not notice that you copied the whole file.

But good you found a solution ;).

Best, Michael

Author:  Faceblind [ 31. Jan 2017, 14:01 ]
Post subject:  Re: Watermark text in multi root

Thanks for your help - I'm new to much of this. I saw in HowTo 17 which seems to suggest copying the whole config.php file. Sorry to bother you more with this, but is there a help or how to which gives more info, and explains what it means to say "only the delta". Just a pointer would be much appreciated. Should I perhaps only copy lines which are different from those in the main config.php in the root twg folder? Andy

Author:  TinyWebGallery [ 31. Jan 2017, 14:56 ]
Post subject:  Re: Watermark text in multi root

I don't see anywhere in the howto that you should copy the whole file. I says you can use a config.php :).

So simply copy the settings you want to change into this folder! It is only a delta.

Always the main config.php is ready an then the custom config.php.

I can add this to the howto...

Best, Michael

Author:  Faceblind [ 3. Feb 2017, 22:19 ]
Post subject:  Re: Watermark text in multi root

Thank you - I understand what you mean now. I think in my head "config.php" was a file, ie the whole file, but that is just me not thinking about it enough I think. What you are describing is actually much easier than I'd imagined. I'm only just realising how php works - I used to use PERL some time ago, but I'm not really a programmer.

Thanks for your support.

Author:  TinyWebGallery [ 5. Feb 2017, 15:54 ]
Post subject:  Re: Watermark text in multi root

:).

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/