Product Name: Watermark_Lib
Product Version: v 1.0
Author: Mohammed Ayman
Email: mohammedayman1070@gmail.com
watermark_lib is a lightwight library that performing various types of watermark on many image types
please be aware that this library works only on the images that stored in your server or your local machine (if you use an Apache server as XAMPP), it does not work on URLs
Installing this library is so easy and requires no time just extract the zip file that you already downloaded and then copy the watermark_script folder to your project directory
you have to paste the watermark_script folder directly in your project directory, do not paste it in a sub directory of your project.
please becarful while editing the source code, it may lead to unexpected behaviour
in your index.php file which is in your main directory of your project paste those two lines below
Create your first watermark on any image in just one line of code, assuming you alredy have watermark_lib integrated succesfuly in your project, if not so please follow the instruction here
just paste the follwing line in your php file
the above code uses WatermarkProducer class to create a text watermark on a given image, by calling the static method static_produce_text_watermark
as you can see the first argument is a string value that defines full path of the source image which we want to put watermark
second argument is a string value that defines the text that you want to use as watermark
the third one is a constant which descripes the type of the watermark, more informations of types of watermark in ‘How does WatermarkProducer work’ section
fifth argument is an array of RGB color which descripes the color of the text
next argument is the angle of the text that used as watermark
last one is the font type of the text.
if the above code does not work properly, then check if your IDE automatically called the namespace of the library if not then copy and paste the following line at the top of your script file .
WatermarkProducer used to add a watermark on images, It contains four methods: two static methods and two non-static methods.
before explaining the four methods,We need to know about the configuration file of the watermark_lib, where all the constants and font types used by the library are defined.
First is the types of watermark:Now after we explained all constants in the configuration file, here is the types of the watermarks that the library can produce:
this method creating a text watermark statically
Paramerters:this method will produce a logo watermark statically
Parameters:same as the static_produce_text_watermark method, you have to instantiate an object from the WatermarkProducer class to use it
same as the static_produce_logo_watermark method, you have to instantiate an object from the WatermarkProducer class to use it