Home > Backend Development > PHP Tutorial > PHP image watermark code, PHP upload image watermark example code

PHP image watermark code, PHP upload image watermark example code

WBOY
Release: 2016-07-25 08:51:47
Original
900 people have browsed it
  1. //Upload file type list
  2. $uptypes=array(
  3. 'image/jpg',
  4. 'image/jpeg',
  5. 'image/png',
  6. 'image/pjpeg',
  7. 'image/gif',
  8. 'image/bmp',
  9. 'image/x-png'
  10. );
  11. $max_file_size=2000000; //Upload file size limit, unit BYTE
  12. $destination_folder="uploadimg/"; / /Upload file path
  13. $watermark=1; //Whether to attach a watermark (1 means adding watermark, others means not adding watermark);
  14. $watertype=1; //Watermark type (1 means text, 2 means picture)
  15. $waterposition =1; //Watermark position (1 is the lower left corner, 2 is the lower right corner, 3 is the upper left corner, 4 is the upper right corner, 5 is in the center);
  16. $waterstring="http://bbs.it-home.org /"; //Watermark string
  17. $waterimg="xplore.gif"; //Watermark image
  18. $imgpreview=1; //Whether to generate a preview image (1 means generated, others do not generate);
  19. $imgpreviewsize=1 /2; //Thumbnail ratio
  20. ?>
  21. ZwelL Image Uploader