allovince / evathumber Goto Github PK
View Code? Open in Web Editor NEWA light-weight url based image transformation php library
Home Page: http://avnpc.com/pages/evathumber
License: BSD 3-Clause "New" or "Revised" License
A light-weight url based image transformation php library
Home Page: http://avnpc.com/pages/evathumber
License: BSD 3-Clause "New" or "Revised" License
Deprecation warning: require-dev.rmccue/Requests is invalid, it should not contain uppercase characters. Please use rmccue/requests instead. Make sure you fix this as Composer 2.0 will error.
Do not run Composer as root/super user! See https://getcomposer.org/root for details
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
浏览器地址输入
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
不明白需要配置些什么。
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
重现过程
q_90
参数调整到末尾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;
}
}
不知道其他的变了没有,反正安装之后没办法生成了,
在EvaThumber目录下执行compose install 是提示输入username , 我不清楚这个username是指的什么,可不可以提供一个username来帮助我安装
试用了一天,感觉URL的配置灵活度还不够
建议把每个单独的操作独立出来,灵活的用管道"|"组合排列,,这样更加灵活一些.
有时候我想把图片首先缩放到指定的宽度和高度,以适应页面布局,同时又要保持图片在裁剪的时候不失去过多的场景.
开启png压缩后,图片加载的速度明显变慢了。虽然图片的大小确实变小了,但是每次重新打开页面,后台就好像重新压缩一遍图片似的,加载速度速度比不打开png压缩还要慢。(用的是wordpress,EvaThumber在子目录,上级目录也有一个.htaccess,不知道是否是因为这样产生了影响)
在 config.local.php 定義 allow_sizes 的大小後, 縮放就失效了?
allow_sizes' => array(
'300*300',
),
http://localhost/thumb/d/father/123,c_fill,f_gray,h_300,w_300.jpg
'disable_operates' => array(
'dummy',
'filter',
'gravity',
'percent',
'quality',
'rotate',
'x',
'extension',
),
打开了'extension'会报错File extension not be set in parameters
config.local.php内source_path参数,填写的是当前EvaThumber下路径。
能否兼容:
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
水印部分基本全部不能用,浪费太多时间
文字水印,有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
目测开发者已经放弃维护,切记切记,不要在浪费时间了
config.local.php内source_path参数,填写的是当前EvaThumber下路径。
能否兼容:
1.填写EvaThumber外路径,例如其他项目project下的upload路径?
2.其他网址的图片,而不单单本地的图片。例如百度的图片,通过请求获取图片处理以后返回图片?
在index.php文件里最后用来处理error_url的地方代码写的有问题,没有正常处理
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
src\parameters.php
line #515 the " $width" should be " $height"
报错如上
Fatal error: Class 'Imagine\Image\Color' not found in C:\wamp\www\source\src\EvaThumber\Thumber.php on line 704
当开启文字水印的时候 会报错
Fatal error: Class 'Imagine\Image\Color' not found in /www/wwwroot/img.baidu.com/EvaThumber/src/EvaThumber/Thumber.php on line 704
打开文字水印的时候出现的报错,试过php56 7 7.1 全部都都有这个问题
当直接访问index.php的时候,或者故意写错的时候,会抛出异常。建议debug =0 的时候屏蔽错误
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.