欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

CodeIgniter图像处理类代码

程序员文章站 2022-03-16 22:33:23
...
  1. define("BASEPATH", dirname(__FILE__).'/');
  2. function &get_instance(&$class_object)
  3. {
  4. return $class_object;
  5. }
  6. function log_message(){}
  7. // 图像处理类位置 CodeIgniter: ./system/libraries/Image_lib.php
  8. include("Image_lib.php");
  9. $config['image_library'] = 'gd2';
  10. $config['source_image'] = "/home/qiufeng/work/test/bdlogo.gif";
  11. $config['create_thumb'] = TRUE;
  12. $config['dynamic_output'] = TRUE;
  13. $config['maintain_ratio'] = TRUE;
  14. $config['width'] = 500;
  15. $config['height'] = 500;
  16. $image = new CI_Image_lib($config);
  17. $image->resize();
复制代码