国内流行的内容管理系统(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.

46 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 DedeBIZ.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. $cfg_photo_type["gif"] = TRUE;
  22. $cfg_photo_typenames[] = "image/gif";
  23. $cfg_photo_support .= "GIF ";
  24. }
  25. if (function_exists("imagecreatefromjpeg") && function_exists("imagejpeg")) {
  26. $cfg_photo_type["jpeg"] = TRUE;
  27. $cfg_photo_typenames[] = "image/pjpeg";
  28. $cfg_photo_typenames[] = "image/jpeg";
  29. $cfg_photo_support .= "JPEG ";
  30. }
  31. if (function_exists("imagecreatefrompng") && function_exists("imagepng")) {
  32. $cfg_photo_type["png"] = TRUE;
  33. $cfg_photo_typenames[] = "image/png";
  34. $cfg_photo_typenames[] = "image/xpng";
  35. $cfg_photo_support .= "PNG ";
  36. }
  37. if (function_exists("imagecreatefromwbmp") && function_exists("imagewbmp")) {
  38. $cfg_photo_type["wbmp"] = TRUE;
  39. $cfg_photo_typenames[] = "image/wbmp";
  40. $cfg_photo_support .= "WBMP ";
  41. }
  42. // 引入图像处理小助手
  43. helper('image');