国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.6KB

  1. <?php if(!defined('DEDEINC')) exit("Request Error!");
  2. /**
  3. * 图像处理相关函数
  4. *
  5. * @version $Id: image.func.php 1 15:59 2010年7月5日Z tianya $
  6. * @package DedeCMS.Helpers
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. include(DEDEDATA.'/mark/inc_photowatermark_config.php');
  12. //检测用户系统支持的图片格式
  13. global $cfg_photo_type,$cfg_photo_typenames,$cfg_photo_support;
  14. $cfg_photo_type['gif'] = FALSE;
  15. $cfg_photo_type['jpeg'] = FALSE;
  16. $cfg_photo_type['png'] = FALSE;
  17. $cfg_photo_type['wbmp'] = FALSE;
  18. $cfg_photo_typenames = Array();
  19. $cfg_photo_support = '';
  20. if(function_exists("imagecreatefromgif") && function_exists("imagegif"))
  21. {
  22. $cfg_photo_type["gif"] = TRUE;
  23. $cfg_photo_typenames[] = "image/gif";
  24. $cfg_photo_support .= "GIF ";
  25. }
  26. if(function_exists("imagecreatefromjpeg") && function_exists("imagejpeg"))
  27. {
  28. $cfg_photo_type["jpeg"] = TRUE;
  29. $cfg_photo_typenames[] = "image/pjpeg";
  30. $cfg_photo_typenames[] = "image/jpeg";
  31. $cfg_photo_support .= "JPEG ";
  32. }
  33. if(function_exists("imagecreatefrompng") && function_exists("imagepng"))
  34. {
  35. $cfg_photo_type["png"] = TRUE;
  36. $cfg_photo_typenames[] = "image/png";
  37. $cfg_photo_typenames[] = "image/xpng";
  38. $cfg_photo_support .= "PNG ";
  39. }
  40. if(function_exists("imagecreatefromwbmp") && function_exists("imagewbmp"))
  41. {
  42. $cfg_photo_type["wbmp"] = TRUE;
  43. $cfg_photo_typenames[] = "image/wbmp";
  44. $cfg_photo_support .= "WBMP ";
  45. }
  46. // 引入图像处理小助手
  47. helper('image');