Copy CodeThe code is as follows:
Original image
$DST = "/upload/20120914/20120914040740-0.jpg"; Note that the picture path should be correct
Get the original picture information
$DST _info = getimagesize ($DST);
Switch ($DST _info[2])
{
Case 1:
$DST _im =imagecreatefromgif ($DST);
Case 2:
$DST _im =imagecreatefromjpeg ($DST);
Case 3:
$DST _im =imagecreatefrompng ($DST);
Case 6:
$DST _im =imagecreatefromwbmp ($DST);
Default
Die ("Unsupported file type 1"); exit;
}
Watermark Image
$SRC = "/images/shuiyin.png"; Note the path to write to
$src _info = getimagesize ($SRC);
Switch ($src _info[2])
{
Case 1:
$SRC _im =imagecreatefromgif ($SRC);
Case 2:
$SRC _im =imagecreatefromjpeg ($SRC);
Case 3:
$SRC _im =imagecreatefrompng ($SRC);
Case 6:
$SRC _im =imagecreatefromwbmp ($SRC);
Default
Die ("Unsupported file type 1"); exit;
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.