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

44 lines
1.6KB

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