Coder Social home page Coder Social logo

allovince / evathumber Goto Github PK

View Code? Open in Web Editor NEW
553.0 67.0 179.0 1.29 MB

A light-weight url based image transformation php library

Home Page: http://avnpc.com/pages/evathumber

License: BSD 3-Clause "New" or "Revised" License

Python 2.01% PHP 97.66% Dockerfile 0.33%

evathumber's Issues

站点BUG

http://evathumber.avnpc.com/thumb/d/demo,w_100.xbm

Fatal error: Uncaught exception 'ErrorException' with message 'call_user_func_array() expects parameter 1 to be a valid callback, function 'imagexbm' not found or invalid function name' in /opt/htdocs/avnpc.com/EvaThumber/vendor/imagine/Imagine/lib/Imagine/Gd/Image.php:572 Stack trace: #0 [internal function]: Imagine\Gd{closure}(2, 'call_user_func_...', '/opt/htdocs/avn...', 572, Array) #1 /opt/htdocs/avnpc.com/EvaThumber/vendor/imagine/Imagine/lib/Imagine/Gd/Image.php(572): call_user_func_array('imagexbm', Array) #2 /opt/htdocs/avnpc.com/EvaThumber/vendor/imagine/Imagine/lib/Imagine/Gd/Image.php(200): Imagine\Gd\Image->saveOrOutput('xbm', Array, '/opt/htdocs/avn...') #3 /opt/htdocs/avnpc.com/EvaThumber/src/EvaThumber/Thumber.php(330): Imagine\Gd\Image->save('/opt/htdocs/avn...', Array) #4 /opt/htdocs/avnpc.com/EvaThumber/src/EvaThumber/Thumber.php(325): EvaThumber\Thumber->saveNormalImage('/opt/htdocs/avn...') #5 /opt/htdocs/avnpc.com/EvaThumber/src/EvaThumber/Thumber.php(270): EvaThumber\Thumber->saveImage() #6 /opt/ht in /opt/htdocs/avnpc.com/EvaThumber/vendor/imagine/Imagine/lib/Imagine/Gd/Image.php on line 679

Notice: Undefined variable: sourcefile in

浏览器地址输入
locaLHOST/thumbers/d/10,d_flickr.png
返回:
Notice: Undefined variable: sourcefile in C:\wamp\www\source\evaThumber\src\EvaThumber\Thumber.php on line 385

Fatal error: Uncaught exception 'EvaThumber\Exception\IOException' with message 'Dummy file name conflict with exsit file ' in C:\wamp\www\source\evaThumber\src\EvaThumber\Thumber.php:383 Stack trace: #0 C:\wamp\www\source\evaThumber\src\EvaThumber\Thumber.php(271): EvaThumber\Thumber->process() #1 C:\wamp\www\source\evaThumber\index.php(49): EvaThumber\Thumber->show() #2 {main} thrown in C:\wamp\www\source\evaThumber\src\EvaThumber\Thumber.php on line 383

不明白需要配置些什么。

InvalidArgumentException

Fatal error: Uncaught EvaThumber\Exception\InvalidArgumentException: No config found by key in D:\phptools\www\img\EvaThumber-master\src\EvaThumber\Url.php:506 Stack trace: #0 D:\phptools\www\img\EvaThumber-master\src\EvaThumber\Thumber.php(288): EvaThumber\Url->__construct(Array, Object(EvaThumber\Config\Config)) #1 D:\phptools\www\img\EvaThumber-master\index.php(45): EvaThumber\Thumber->__construct(Object(EvaThumber\Config\Config)) #2 {main} thrown in D:\phptools\www\img\EvaThumber-master\src\EvaThumber\Url.php on line 506

参数位置不同导致的跳转问题

重现过程

  1. 进入如下链接正常
    http://www.jiachongs.com:8081/thumb/d/3193,c_1000,g_800,q_90,x_400,y_200.jpg
  2. q_90参数调整到末尾
    http://www.jiachongs.com:8081/thumb/d/3193,c_1000,g_800,x_400,y_200,q_90.jpg
    导致跳转到如下链接,并且端口号消失
    http://www.jiachongs.com/thumb/d/3193,c_1000,g_800,q_30,x_400,y_200.jpg

Nginx配置如下:

server {
listen 8081;
server_name www.jiachongs.com;
root /root/jiachongs/EvaThumber;
location / {
index index.php index.htm index.html;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php last;
}
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /root/jiachongs/EvaThumber/$fastcgi_script_name;
include fastcgi_params;
}
}

建议重构URL解析以支持类似Linux命令行管道的概念

试用了一天,感觉URL的配置灵活度还不够
建议把每个单独的操作独立出来,灵活的用管道"|"组合排列,,这样更加灵活一些.

有时候我想把图片首先缩放到指定的宽度和高度,以适应页面布局,同时又要保持图片在裁剪的时候不失去过多的场景.

开启png压缩后缓存好像失效了

开启png压缩后,图片加载的速度明显变慢了。虽然图片的大小确实变小了,但是每次重新打开页面,后台就好像重新压缩一遍图片似的,加载速度速度比不打开png压缩还要慢。(用的是wordpress,EvaThumber在子目录,上级目录也有一个.htaccess,不知道是否是因为这样产生了影响)

File extension not be set in parameters

'disable_operates' => array(
'dummy',
'filter',
'gravity',
'percent',
'quality',
'rotate',
'x',
'extension',
),
打开了'extension'会报错File extension not be set in parameters

image redirect port error

When access a image with a size smaller than the original one, the url will be redirect to the original, and then the port in the url is error.

Below is the image url I try to access, and the redirect location port is empty but have a colon in it. When you this port format url image to pinterest, an share error may occur.

$ curl -I -L http://p1.funnypicker.com/picture/fp/190/87/img_1219087_52719e00ac665750808,w_500.jpeg
HTTP/1.1 302 Moved Temporarily
Server: zws/0.0.1
Date: Fri, 01 Nov 2013 20:31:24 GMT
Content-Type: image/jpeg
Connection: keep-alive
location: http://p1.funnypicker.com:/picture/fp/190/87/img_1219087_52719e00ac665750808.jpeg
Expires: Sun, 01 Dec 2013 20:31:24 GMT
Cache-Control: max-age=2592000

This is my solution, and works well
Uploading evathumb_port_error.png . . .

水印部分基本全部不能用,浪费太多时间

水印部分基本全部不能用,浪费太多时间
文字水印,有bug说过了
图片水印,只有默认的那个水印是可以的,随便上传个水印,老是说水印不存在,我也是醉了

Fatal error: Uncaught Imagine\Exception\InvalidArgumentException: File /www/wwwroot/www.handleimg.com/EvaThumber/layers/watermark.png does not exist. in /www/wwwroot/www.handleimg.com/EvaThumber/vendor/imagine/imagine/lib/Imagine/Image/AbstractImagine.php:67 Stack trace: #0 /www/wwwroot/www.handleimg.com/EvaThumber/vendor/imagine/imagine/lib/Imagine/Gd/Imagine.php(86): Imagine\Image\AbstractImagine->checkPath('/www/wwwroot/ww...') #1 /www/wwwroot/www.handleimg.com/EvaThumber/src/EvaThumber/Thumber.php(690): Imagine\Gd\Imagine->open('/www/wwwroot/ww...') #2 /www/wwwroot/www.handleimg.com/EvaThumber/src/EvaThumber/Thumber.php(417): EvaThumber\Thumber->layer() #3 /www/wwwroot/www.handleimg.com/EvaThumber/src/EvaThumber/Thumber.php(271): EvaThumber\Thumber->process() #4 /www/wwwroot/www.handleimg.com/EvaThumber/index.php(50): EvaThumber\Thumber->show() #5 {main} thrown in /www/wwwroot/www.handleimg.com/EvaThumber/vendor/imagine/imagine/lib/Imagine/Image/AbstractImagine.php on line 67

目测开发者已经放弃维护,切记切记,不要在浪费时间了

source_path地址能否兼容EvaThumber外路径和其他网址的图片?

config.local.php内source_path参数,填写的是当前EvaThumber下路径。
能否兼容:
1.填写EvaThumber外路径,例如其他项目project下的upload路径?
2.其他网址的图片,而不单单本地的图片。例如百度的图片,通过请求获取图片处理以后返回图片?

PHP Fatal error ? 出現在 apache error log , 是正常的嗎?

PHP Fatal error: Uncaught exception 'EvaThumber\Exception\InvalidArgumentException' with message 'No config found by key ' in /var/www/EvaThumber/src/EvaThumber/Thumber.php:296\nStack trace:\n#0 /var/www/EvaThumber/index.php(46): EvaThumber\Thumber->__construct(Object(EvaThumber\Config\Config))\n#1 {main}\n thrown in /var/www/EvaThumber/src/EvaThumber/Thumber.php on line 296

建议屏蔽错误

当直接访问index.php的时候,或者故意写错的时候,会抛出异常。建议debug =0 的时候屏蔽错误

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.