Watermark
Downloads of Watermark are restricted to logged in users. If you do not have a user account on the TNG Wiki use the Request Account link to request a user account | ||
If you have trouble downloading with Google Chrome, Vivaldi, Brave or other Chromium based browser, try using a right-click and select Open in new Window, then F5, or use another browser such as Firefox |
The latest version of this mod uses the guidelines for TNG v12+ cust_text.php files. If you are using TNGv12+, and any cust_text.php file in this mod is marked with a Bad Target error, you need to update your cust_text.php files before you can install this mod. [Show instructions]
If you upgraded to TNGv12+, and did not update your cust_text.php files as instructed in the upgrade readme script, then you must use the TNG Mod Manager to update them. To do so:
[See details in the TNGv12 Change Impacts Article][Hide the instructions] |
|
Watermark | |||||
---|---|---|---|---|---|
Summary | Shows a watermarked image instead the original image. | ||||
Validation | |||||
Mod Updated | 09 Dec 2023 | ||||
Download link | For
>For
>For
v12.2.0.2e | ||||
Download stats | Montrer les statistiques | ||||
Author(s) | Michel Kirsch | ||||
Homepage | Racines luxo-hennuyeres | ||||
Mod Support | TNG Community Forums | ||||
Contact Developer | |||||
Latest Mod | V14.0.0.5a for TNG 14.0+ V13.1.0.4d for TNG 13.1+ v12.2.0.2e for TNG v12 & 13 | ||||
Min TNG V | v12.2+ | ||||
Max TNG V | nc | ||||
Files modified | admin_users.php browsemedia.php functions.php genstyle.css globallib.php headstones.php img_viewer.php languages/English-UTF8/cust_text.php languages/English/cust_text.php languages/French-UTF8/cust_text.php languages/French/cust_text.php mostwanted.php personlib.php randomphoto.php showalbum.php showmap.php showmedialib.php suggest.php templates/template10/index.php | ||||
Related Mods | |||||
Notes |
Note
From version 14.0.0.5
- a new TNG module is impacted : suggest.php
- location of the "Empty the watermark cache" button is now in Administration >> media
- The way a user can ask for a media without watermark is done now via the suggest.php form (Thx to Rob Severijns for the idea!)
Purpose of the Mod
This Mod watermarks your images on the fly and hides their names to prevent image theft. Your original images are not altered.
The watermark is customizable: text, color, tilt, transparency, repetition and font.
[Optional] : Your users can request an unwatermarked copy of the media they are viewing
You can designate some of your users (via Administration/Users) so they can view the media without watermark
Users of the List_Media mod must use the v13.0.1.4 + or 12.2.0.2e + version of watermark in order to see watermarked images on browseyear.php and browseowner.php
Users of the Showfolio mod must use the v13.0.1.4a + version of watermark in order to see watermarked images on showfolio.php
Thanks to
Ron, Philippe, Jean-Louis, Pascal and Alain Evrard for their tests, ideas and comments to realize this first version !
Brent for his inestimable work to take this Mod to an higher level.
DeepL.com for some translations...
Mod Developer
Written by : Michel Kirsch from Charleroi - Hainaut - Belgium
Requirements
- A working TNG installation.
- A backup of all affected files (see the list in the summary in the upper right corner of the page)
- An installed current version of the Mod Manager.
Users of the Mod Add cousins button will update their version with the version 1b to standardize the appearance of the table of users.
Revision History
Mod Version | TNG Version | Date | Contents |
---|---|---|---|
14.0.0.5a | 14.0.+ | 09 Dec 2023 | Processes unlinked media when requesting unwatermarked media - Fixed a mismatch between Dutch and English language files |
14.0.0.5 | 14.0.+ | 07 Feb 2023 | Important ! Changed the location of the "Empty the cache" button. Now in Admin >> Media. Asking a media without watermark is now done via the suggest.php form - Compatible with the future "Private media" Mod |
13 & 14 v4d | 13 & 14 | 07 Feb 2023 | Extends 4c for the What's new page too. |
13 & 14 v4c | 13 & 14 | 31 Jan 2023 | Now, previews of media from excluded directories are no more watermarked. |
13 & 14 v4b | 13 & 14 | 10 Jan 2023 | Adds Dutch language (Thx to Rob Severijns) |
14.0.0.4a | 14 | 21 Oct 2022 | TNG 14.0 ready - Modified to install and work with Add Cousins Button v14.0.0.1c+ |
13.1.0.4a | 13.1 | 22 Nov 2021 | Showfolio mod is now taken in account if installed. - Modif vars file to avoid error with html accented char - Changing conditions for watermark error err03 |
13.1.0.4 12.2.0.2e |
12 & 13.1 | 06 Nov 2021 | List Media mod is now taken in account. |
13.1.0.3 | 13.1 | 21 Oct 2021 | ONLY for TNG 13.1 + !! New icons, uses wsmallicon class. Compatible with the Admin Users Menu Mod. |
12.2.0.2d | 12.2 | 20 May 2021 | modif file watermark.php to avoid a non user to create a media basket (for crawlers) Suppress the error_reporting( E_ALL ) command into watermark.php |
12.2.0.2c | 12.2 | 02 Apr 2021 | Some ISP doesn't allow the ZipArchive Class. Force the downloading of txt files. |
12.2.0.2b | 12.2 | 04 May 2021 | Protect mediabasket against crawlers (for open sites). |
12.2.0.2 | 12.2 | 02 Apr 2021 | Many major reviews of the code. Many thanks to Brent Hemphill ! |
12.2.0.1h | 12.2 | 07 Mar 2021 | Compatible with Admin Users Menu Mod - In the allowed users list, the first name was never deleted ! |
12.2.0.1f | 12.2 | 30 Jan 2021 | Adds 2 new parameters : Display 2 lines of watermark diagonally and Show or not the "command without watermark" line. Modify some calculations |
12.2.0.1e | 12.2 | 11 Jan 2021 | Internal modifications to avoid Mods conflicts, warnings and notices. Secure the allowed users list |
12.2.0.1c | 12.2 | 28 Jul 2020 | New option to NOT watermark the pictures from one or more folders. Your file RootTNG/extensions/watermark_mod_vars.php is protected against overwriting. You MUST delete or rename it manually before installing this version ! |
12.2.0.1b | 12.2 | 10 Jun 2020 | Doesn't try to watermark if file's MIME type is not 'image' |
12.2.0.1a | 12.2 | 06 Apr 2020 | Fix problems with the mysqli_fetch_all() function, replaced with mysqli_fetch_array() |
12.2.0.1 | 12.2 | 04 Mar 2020 | First online version. |
IMPORTANT : Before installing
- Before installing, it is judicious to make a backup copy of the files that will be modified by this mod.
TNG Modules Impacted
The following TNG Modules are modified, and should be backed up prior to installing this mod:
admin_users.php
browsemedia.php
functions.php
globallib.php
headstones.php
img_viewer.php
languages/English-UTF8/cust_text.php
languages/English/cust_text.php
languages/French-UTF8/cust_text.php
languages/French/cust_text.php
mostwanted.php
personlib.php
randomphoto.php
showalbum.php
showmap.php
showmedialib.php
suggest.php
templates/template10/index.php
Files created/copied by this Mod
Source | Destination |
---|---|
watermark_4/watermark_error.gif | TNG root/img/watermark_error.gif |
watermark_4/watermark_no.gif | TNG root/img/watermark_no.gif |
watermark_5/watermark_yes.gif | TNG root/img/watermark_yes.gif |
watermark_5/watermodfont.ttf | TNG root/font/watermodfont.ttf |
(protected)watermark_5/watermark_mod_allowedusers.txt | TNG root/$extspath/watermark_mod_allowedusers.txt |
(protected)watermark_5/watermark_mod_vars.php | TNG root/$extspath/watermark_mod_vars.php |
1 file by xxxx language is created : (Actually English, Dutch and French) | TNG Root/languages/xxxx and xxxx-UTF8/water_text.php |
Conflicts
Version 13.1.0.3 and above solve a compatibility problem with the Admin_Users_Menu Mod.
Watermark is upgraded to work with the following mods :
List Media. watermark v13.1.0.4+. List Media must be installed prior to install Watermark.
Installation
- Uninstall and delete previous version of this mod (if installed)
- Download the appropriate zip file as shown in the mod summary in the upper right corner of the page.
- Extract the file from the downloaded zip file into the mods folder or FTP the extracted file to your mods folder.
- Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the mod.
In the event of a problem
- Try using the Mod Manager Remove capability
- Copy the backup of the affected files back to your TNG directory
- Contact us through the TNG Community Forums or on the page of Michel Kirsch. At worst, send a mail to
Uninstalling the mod
If you want to completely Remove (uninstall) this mod and any tables if created, you should
- click the Uninstall button to uninstall the mod
- click the Delete button to delete the config file from the mods folder.
Upgrade
- Uninstall and eventually Delete the current Mod.
- Proceed as for an installation with the new Mod.
- Your files watermark_mod_vars.php and watermark_mod_allowedusers.txt are copy protected and will not crushed by the new installation.
- Upgrade from VERSION 12.2.0.1g and below : You MUST manually delete, rename or complete your TNGRoot/extensions/watermark_mod_vars.php before installing this version !!
Known Problems
With some too large files, you may receive a message "Fatal error: Allowed memory size of ...". Refresh your browser (F5).
If the problem persists, you can try to reduce the number of results during queries ( Administration/Setup/General Settings/Miscellaneous/Max Search Results:). Try to reduce this number...
Parameters
When you change certain settings, it is imperative that you clear the cache of already watermarked media to see the effect of your changes.
To do this, go to Administration >> Media (New in v14.0.0.5) to open your admin_media.php page.
There you will find a link allowing you to empty the cache. This option is only reachable for Administrators. You can also clear the cache files (mods/watermark_mod_cache/) manually.
Parameters:
Text: You can use 2 lines for the watermark. These two lines are separated in the Text parameter by " -x- " (space dash x space dash)
In addition to the common options text, color, transparency, font, owner and proportionality,
If you use the option Angle = "45"
version 1f: A new option allows you to display two lines of watermarks diagonally. The result is NOT guaranteed!
You can determine whether the watermark will be repeated 2 or 3 times on the image.Only the first line of text appears.
If you use the option Angle = "0"
You can use the vpos option to "top" or "bottom". The Repeat option must be imperatively set to "1".
These are the only cases where both lines of the watermark appear.
Repeat on "2" or "3" deletes the second line.
version 1f : you can suppress the possibility of ordering the media without a watermark.
Translations
To translate this Mod, it is necessary to provide the translation of these variables :
cust_text.php file
$watertxt['getit'] = "Get this media without watermark"; $watertxt['autorized'] = "The User is allowed to see media without watermark"; $watertxt['notautorized'] = "The User is NOT allowed to see media without watermark"; $watertxt['wmk'] = "Watermark"; $watertxt['emptybuttontext'] = "Empty the watermark cache";
water_text.php file
$watertxt['entityI'] = "person"; $watertxt['entityF'] = "family"; $watertxt['err02'] = "ERROR 02 : The Watermark font <b>$waterfont</b> cannot be found! The media item has NOT been watermarked OR cached.<br>"; $watertxt['err03'] = "ERROR 03 : Cannot find the original image $image_source. <br> Path => $realpath<br> Cache => $watermark_dir <br> Image Name => $imagename ($imgname) <br> Extension => $extension<br> mediatypeID = $mediatypeID<br> Real Path = $realpath <p>"; $watertxt['err04'] = "ERROR 04 : There was no Name found for this media item<br>"; $watertxt['err05'] = "ERROR 05 : Person / FamilyID could not be found for the media item $mymediaID and tree = $mytree<br>"; $watertxt['err06'] = "ERROR 06 : The file $filename could not be opened<br>"; $watertxt['command'] = "Your request for the original media file has been written to your 'request file', for media item = $mymediaID, tree = $mytree and $entity = $myPersFamID ( $myref $mydescription ) <p>You can download your 'request file' by clicking <font color=\"red\">" . "<a href=\"{$cms['tngpath']}$file_to_load\">this link</a></font> <p> To obtain the selected media items, send a detailed e-mail to the site's owner and attach your request file to your e-mail. <p> Click the <font color=\"blue\">back button</font> of your browser to go back to the showmedia page";
Visualization
This image shows different styles of watermarks. From L to R:
(1) Angle 45 - Repeat 1 - Transparency 80 - (2) Angle 45 - Repeat 2 - Transparency 20 - (3) Angle 0 - vpos bottom - Repeat 1 - 2 lines - Proportioned
(4) Idem - vpos top - NOT proportioned - (5) Angle 0 - Repeat 3 - Proportioned
The bottom of showmedia.php page. Notice the filename unrelevant, the owner field and the possibility for user to command a not watermarked image. (from version 1f, these possibility can be disabled)
The user table with the new icon for watermark. A green icon means that this user will view the photos WITHOUT watermark.
Sites using this mod
If you download and install this mod, please add your TNG site to the table below: If you have any problem to do it, send me a mail...
- Mods for TNG v14
- Mods for TNG v13
- Mods for TNG v12
- Admin users.php mods
- Browsemedia.php mods
- Functions.php mods
- Genstyle.css mods
- Globallib.php mods
- Headstones.php mods
- Img viewer.php mods
- Mostwanted.php mods
- Personlib.php mods
- Randomphoto.php mods
- Showalbum.php mods
- Showmap.php mods
- Showmedialib.php mods
- Suggest.php mods
- Index.php Template 10 mods
- Cust text.php English mods
- Cust text.php Dutch mods
- Cust text.php French mods