Git Product home page Git Product logo

zimg's Introduction

zimg

Project zimg is a lightweight image storage and processing system. It's written in C and it has high performance in image field. The zimg is designed for high concurrency image server. It supports many features for storing and processing images.

Homepage: zimg.buaa.us
Author: @招牌疯子
Contact me: [email protected]

Build Status wercker status Join the chat at https://gitter.im/buaazp/zimg

Versions:

  • 05/11/2017 - zimg 3.2.0 Release. Fix build issues with 3rd dependences.
  • 09/09/2014 - zimg 3.1.0 Release. New generation.
  • 04/26/2014 - zimg 2.0.0 Release. Supported distributed storage backends.
  • 08/01/2013 - zimg 1.0.0 Release.

Synopsis

  • The zimg is an image storage and processing server. You can get a compressed and scaled image from zimg with the parameters of URL.
    http://demo.buaa.us/5f189d8ec57f5a5a0d3dcba47fa797e2?w=500&h=500&g=1&x=0&y=0&r=45&q=75&f=jpeg

  • The parameters contain width, height, resize type, gray, crop position (x, y), rotate, quality and format. And you can control the default type of images by configuration file.
    And you can get the information of image in zimg server like this:
    http://demo.buaa.us/info?md5=5f189d8ec57f5a5a0d3dcba47fa797e2

  • If you want to customize the transform rule of image you can write a zimg-lua script. Goto API of zimg-lua for more information. Use t=type parameter in your URL to get the special image:
    http://demo.buaa.us/5f189d8ec57f5a5a0d3dcba47fa797e2?t=webp500

  • The concurrent I/O, distributed storage and in time processing ability of zimg is excellent. You needn't nginx in your image server any more. In the benchmark test, zimg can deal with 3000+ image downloading task per second and 90000+ HTTP echo request per second on a high concurrency level. The performance is higher than PHP or other image processing server. More information of zimg is in the documents below.

Supplying:

Uploading, downloading and processing images through HTTP protocol.
High performance in concurrency I/O and compressing image.
Support lua scripts to deal with customize compressing strategy.
Support memcached and redis protocols to save images into distributed storage backends.
Varied config options for operation and maintenance.

More usages are in Guidebook of zimg.

Build:

You should build dependences first. If you want to use distributed storage, make sure the optional storage backends beansdb(memcached protocol), or ssdb(redis protocol) is working well.
More information of building zimg is in Install Guide.

git clone https://github.com/buaazp/zimg -b master --depth=1
cd zimg   
make  
cd bin  
./zimg conf/zimg.lua

Thanks to:

We stand on the shoulders of giants.

libevhtp: A more flexible replacement for libevent's httpd API.
LuaJIT: LuaJIT is JIT compiler for the Lua language.
imagemagick: A software suite to create, edit, compose, or convert bitmap images.
hiredis: Hiredis is a minimalistic C client library for the Redis database.
libmemcached: LibMemcached is designed to provide the greatest number of options to use Memcached.

[Optional] For Storage:

memcached: A distributed memory object caching system.
beansdb: Beansdb is a distributed key-value storage system designed for large scale online system, aiming for high avaliablility and easy management.
beanseye: Beanseye is proxy and monitor for beansdb, written in Go.
SSDB: SSDB is a high performace key-value(key-string, key-zset, key-hashmap) NoSQL database, an alternative to Redis.
twemproxy: Twemproxy is a fast and lightweight proxy for memcached and redis protocol.

Documents:

There are several documents to introduce the design and architecture of zimg:
Documents of zimg
And this picture below shows the architecture of zimg's storage:

architecture_of_zimg_v3

Download:

The source code is licensed under a BSD-like License.
All versions on Github.

Feedback:

If you have any question, please submit comment in my BLOG or mention me on Weibo, twitter.
Technical issues are also welcomed to be submitted on GitHub Issues.

zimg's People

Contributors

amyangfei avatar bitdeli-chef avatar buaazp avatar felixonmars avatar lytsing avatar qiutiaoming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zimg's Issues

弱问一个make error

系统是ubuntu 14.04(虚拟机),package 安装了 openssl libevent-dev cmake imagemagick libmagickwand-dev libmemcached-dev build-essential
编译:
cd zimg
make

错误:

Linking C executable zimg
/usr/bin/ld: CMakeFiles/zimg.dir/lua/lmathlib.c.o: undefined reference to symbol 'fmod@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [zimg] Error 1
make[3]: Leaving directory `/home/xinchenm/zimg/build/zimg'
make[2]: *** [CMakeFiles/zimg.dir/all] Error 2
make[2]: Leaving directory `/home/xinchenm/zimg/build/zimg'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/xinchenm/zimg/build/zimg'
cp: cannot stat ‘zimg’: No such file or directory
make: *** [all] Error 

不知道是不是自己的环境配置的有问题?好像是link不上math库..

build 不起来啊

Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!

包都安装好了,但是build一直这个错

能否支持固定图片名称

您好,zimg上传图片都会产生一个新的url。当用于用户头像存储的时候,外部系统需要链接到这个头像的地址。如果更改了用户头像图片,外部系统无法随之更新,造成一定困扰。能否在下个版本考虑下这种问题呢?比如在上传图片的时候固定一个名称,通过名称也可以访问这个图片,通过md5也可以访问这个图片。

请求图片发生错误:./zimg: double free or corruption (out)

请求这样一个链接
http://myhost:4869/83ebab5a10269995d230a2a0a26c1791?w=300&h=300
发生如下错误:

*** glibc detected *** ./zimg: double free or corruption (out): 0x00007fdb08000020 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x76166)[0x7fdb1debc166]
/lib64/libc.so.6(+0x78ca3)[0x7fdb1debeca3]
./zimg(get_img+0x460)[0x40df40]
./zimg(send_document_cb+0x751)[0x409ce1]
./zimg[0x4119c0]
./zimg(htparser_run+0xbfb)[0x41643b]
./zimg[0x412b71]
/usr/local/lib/libevent-2.0.so.5(+0x19ee5)[0x7fdb1efc2ee5]
/usr/local/lib/libevent-2.0.so.5(event_base_loop+0x53c)[0x7fdb1efbae0c]
./zimg[0x40f3b2]
/lib64/libpthread.so.0(+0x79d1)[0x7fdb1e1e19d1]
/lib64/libc.so.6(clone+0x6d)[0x7fdb1df2eb7d]
======= Memory map: ========
00400000-00455000 r-xp 00000000 ca:01 417831                             /root/soft/zimg/bin/zimg
00655000-00656000 rw-p 00055000 ca:01 417831                             /root/soft/zimg/bin/zimg
00656000-00657000 rw-p 00000000 00:00 0 
01401000-01422000 rw-p 00000000 00:00 0                                  [heap]
7fdb08000000-7fdb080b2000 rw-p 00000000 00:00 0 
7fdb080b2000-7fdb0c000000 ---p 00000000 00:00 0 
7fdb0c000000-7fdb0c021000 rw-p 00000000 00:00 0 
7fdb0c021000-7fdb10000000 ---p 00000000 00:00 0 
7fdb10000000-7fdb10021000 rw-p 00000000 00:00 0 
7fdb10021000-7fdb14000000 ---p 00000000 00:00 0 
7fdb161fd000-7fdb161fe000 ---p 00000000 00:00 0 
7fdb161fe000-7fdb16bfe000 rw-p 00000000 00:00 0 
7fdb16bfe000-7fdb16bff000 ---p 00000000 00:00 0 
7fdb16bff000-7fdb175ff000 rw-p 00000000 00:00 0 
7fdb175ff000-7fdb17600000 ---p 00000000 00:00 0 
7fdb17600000-7fdb18000000 rw-p 00000000 00:00 0 
7fdb18000000-7fdb18021000 rw-p 00000000 00:00 0 
7fdb18021000-7fdb1c000000 ---p 00000000 00:00 0 
7fdb1c376000-7fdb1c377000 ---p 00000000 00:00 0 
7fdb1c377000-7fdb1cd77000 rw-p 00000000 00:00 0 
7fdb1cd77000-7fdb1ce5f000 r-xp 00000000 ca:01 672480                     /usr/lib64/libstdc++.so.6.0.13
7fdb1ce5f000-7fdb1d05f000 ---p 000e8000 ca:01 672480                     /usr/lib64/libstdc++.so.6.0.13
7fdb1d05f000-7fdb1d066000 r--p 000e8000 ca:01 672480                     /usr/lib64/libstdc++.so.6.0.13
7fdb1d066000-7fdb1d068000 rw-p 000ef000 ca:01 672480                     /usr/lib64/libstdc++.so.6.0.13
7fdb1d068000-7fdb1d07d000 rw-p 00000000 00:00 0 
7fdb1d07d000-7fdb1d093000 r-xp 00000000 ca:01 729309                     /lib64/libgcc_s-4.4.7-20120601.so.1
7fdb1d093000-7fdb1d292000 ---p 00016000 ca:01 729309                     /lib64/libgcc_s-4.4.7-20120601.so.1
7fdb1d292000-7fdb1d293000 rw-p 00015000 ca:01 729309                     /lib64/libgcc_s-4.4.7-20120601.so.1
7fdb1d293000-7fdb1d2a0000 r-xp 00000000 ca:01 673377                     /usr/lib64/libgomp.so.1.0.0
7fdb1d2a0000-7fdb1d49f000 ---p 0000d000 ca:01 673377                     /usr/lib64/libgomp.so.1.0.0
7fdb1d49f000-7fdb1d4a0000 rw-p 0000c000 ca:01 673377                     /usr/lib64/libgomp.so.1.0.0
7fdb1d4a0000-7fdb1d4b5000 r-xp 00000000 ca:01 729151                     /lib64/libz.so.1.2.3
7fdb1d4b5000-7fdb1d6b4000 ---p 00015000 ca:01 729151                     /lib64/libz.so.1.2.3
7fdb1d6b4000-7fdb1d6b5000 r--p 00014000 ca:01 729151                     /lib64/libz.so.1.2.3
7fdb1d6b5000-7fdb1d6b6000 rw-p 00015000 ca:01 729151                     /lib64/libz.so.1.2.3
7fdb1d6b6000-7fdb1d997000 r-xp 00000000 ca:01 674700                     /usr/local/lib/libMagickCore-6.Q16.so.2.0.0
7fdb1d997000-7fdb1db96000 ---p 002e1000 ca:01 674700                     /usr/local/lib/libMagickCore-6.Q16.so.2.0.0
7fdb1db96000-7fdb1dc3c000 rw-p 002e0000 ca:01 674700                     /usr/local/lib/libMagickCore-6.Q16.so.2.0.0
7fdb1dc3c000-7fdb1dc3e000 rw-p 00000000 00:00 0 
7fdb1dc3e000-7fdb1dc45000 r-xp 00000000 ca:01 729419                     /lib64/librt-2.12.so
7fdb1dc45000-7fdb1de44000 ---p 00007000 ca:01 729419                     /lib64/librt-2.12.so
7fdb1de44000-7fdb1de45000 r--p 00006000 ca:01 729419                     /lib64/librt-2.12.so
7fdb1de45000-7fdb1de46000 rw-p 00007000 ca:01 729419                     /lib64/librt-2.12.so
7fdb1de46000-7fdb1dfd1000 r-xp 00000000 ca:01 729100                     /lib64/libc-2.12.so
7fdb1dfd1000-7fdb1e1d0000 ---p 0018b000 ca:01 729100                     /lib64/libc-2.12.so
7fdb1e1d0000-7fdb1e1d4000 r--p 0018a000 ca:01 729100                     /lib64/libc-2.12.so
7fdb1e1d4000-7fdb1e1d5000 rw-p 0018e000 ca:01 729100                     /lib64/libc-2.12.so
7fdb1e1d5000-7fdb1e1da000 rw-p 00000000 00:00 0 
7fdb1e1da000-7fdb1e1f1000 r-xp 00000000 ca:01 729124                     /lib64/libpthread-2.12.so
7fdb1e1f1000-7fdb1e3f1000 ---p 00017000 ca:01 729124                     /lib64/libpthread-2.12.so
7fdb1e3f1000-7fdb1e3f2000 r--p 00017000 ca:01 729124                     /lib64/libpthread-2.12.so
7fdb1e3f2000-7fdb1e3f3000 rw-p 00018000 ca:01 729124                     /lib64/libpthread-2.12.so
7fdb1e3f3000-7fdb1e3f7000 rw-p 00000000 00:00 0 
7fdb1e3f7000-7fdb1e3f9000 r-xp 00000000 ca:01 729413                     /lib64/libdl-2.12.so
7fdb1e3f9000-7fdb1e5f9000 ---p 00002000 ca:01 729413                     /lib64/libdl-2.12.so
7fdb1e5f9000-7fdb1e5fa000 r--p 00002000 ca:01 729413                     /lib64/libdl-2.12.so
7fdb1e5fa000-7fdb1e5fb000 rw-p 00003000 ca:01 729413                     /lib64/libdl-2.12.so
7fdb1e5fb000-7fdb1e67e000 r-xp 00000000 ca:01 729414                     /lib64/libm-2.12.so
7fdb1e67e000-7fdb1e87d000 ---p 00083000 ca:01 729414                     /lib64/libm-2.12.so
7fdb1e87d000-7fdb1e87e000 r--p 00082000 ca:01 729414                     /lib64/libm-2.12.so
7fdb1e87e000-7fdb1e87f000 rw-p 00083000 ca:01 729414                     /lib64/libm-2.12.so
7fdb1e87f000-7fdb1e8ae000 r-xp 00000000 ca:01 674772                     /usr/local/lib/libmemcached.so.11.0.0
7fdb1e8ae000-7fdb1eaae000 ---p 0002f000 ca:01 674772                     /usr/local/lib/libmemcached.so.11.0.0
7fdb1eaae000-7fdb1eaaf000 rw-p 0002f000 ca:01 674772                     /usr/local/lib/libmemcached.so.11.0.0
7fdb1eaaf000-7fdb1eba3000 r-xp 00000000 ca:01 674704                     /usr/local/lib/libMagickWand-6.Q16.so.2.0.0
7fdb1eba3000-7fdb1eda3000 ---p 000f4000 ca:01 674704                     /usr/local/lib/libMagickWand-6.Q16.so.2.0.0
7fdb1eda3000-7fdb1eda7000 rw-p 000f4000 ca:01 674704                     /usr/local/lib/libMagickWand-6.Q16.so.2.0.0
7fdb1eda7000-7fdb1eda9000 r-xp 00000000 ca:01 674752                     /usr/local/lib/libevent_pthreads-2.0.so.5.1.9
7fdb1eda9000-7fdb1efa8000 ---p 00002000 ca:01 674752                     /usr/local/lib/libevent_pthreads-2.0.so.5.1.9
7fdb1efa8000-7fdb1efa9000 rw-p 00001000 ca:01 674752                     /usr/local/lib/libevent_pthreads-2.0.so.5.1.9
7fdb1efa9000-7fdb1efed000 r-xp 00000000 ca:01 674686                     /usr/local/lib/libevent-2.0.so.5.1.9
7fdb1efed000-7fdb1f1ec000 ---p 00044000 ca:01 674686                     /usr/local/lib/libevent-2.0.so.5.1.9
7fdb1f1ec000-7fdb1f1ee000 rw-p 00043000 ca:01 674686                     /usr/local/lib/libevent-2.0.so.5.1.9
7fdb1f1ee000-7fdb1f20e000 r-xp 00000000 ca:01 729479                     /lib64/ld-2.12.so
7fdb1f3fc000-7fdb1f3fd000 rw-p 00000000 00:00 0 
7fdb1f3fd000-7fdb1f405000 rw-p 00000000 00:00 0 
7fdb1f40a000-7fdb1f40b000 rw-p 00000000 00:00 0 
7fdb1f40b000-7fdb1f40d000 rw-p 00000000 00:00 0 
7fdb1f40d000-7fdb1f40e000 r--p 0001f000 ca:01 729479                     /lib64/ld-2.12.so
7fdb1f40e000-7fdb1f40f000 rw-p 00020000 ca:01 729479                     /lib64/ld-2.12.so
7fdb1f40f000-7fdb1f410000 rw-p 00000000 00:00 0 
7fffbcbd1000-7fffbcbe6000 rw-p 00000000 00:00 0                          [stack]
7fffbcbff000-7fffbcc00000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

zimg.log error

2014/12/05 23:10:50:801456 [DEBUG] Method: 0
2014/12/05 23:10:50:801544 [DEBUG] Got a GET request for </d79054e005f243af95aa37ae9596cf64>
2014/12/05 23:10:50:801572 [DEBUG] md5 of request is <d79054e005f243af95aa37ae9596cf64>
2014/12/05 23:10:50:801599 [DEBUG] get_img() start processing zimg request...
2014/12/05 23:10:50:801859 [DEBUG] Beansdb Result: NOT FOUND
2014/12/05 23:10:50:801898 [DEBUG] key: d79054e005f243af95aa37ae9596cf64 is not exist!
2014/12/05 23:10:50:801925 [DEBUG] Image [d79054e005f243af95aa37ae9596cf64] is not existed.
2014/12/05 23:10:50:801947 [DEBUG] zimg Requset Get Image[MD5: d79054e005f243af95aa37ae9596cf64] Failed!
2014/12/05 23:10:50:801969 [ERROR] 122.92.36.213 fail pic:d79054e005f243af95aa37ae9596cf64 w:640 h:0 p:1 g:0 x:-1 y:-1 r:0 q:90 f:jpeg
2014/12/05 23:10:50:802008 [DEBUG] ============get_request_cb() ERROR!===============

请问这是什么原因导致的,该如何预防,今天重新上传后,可以上传成功。

How do I call an API for verified user to post images only?

  1. How do I call an API for only verified user to post images?
    e.g. server response code of "1" from another server with a submitted string and then only allow for upload.
  2. and how can i change the image naming? instead of md5ing it, i would like it to have a submitted query as filename (can u point to the file location for modification for this?)

How to set the beanseye configuration when useing zimg server ?

Hi,
We will use zimg in our project. We want to use beansdb as storage. We use two beanseye (IP : 192.168.1.1 and 192.168.1.2) and 4 beansdb(192.168.1.3-192.168.1.6) . Each beanseye proxy 2 beansdb.I saw your testing result about beansdb.I think that you must konw about beanseye config options clearly. but I don't know how to set some options in the yaml file about beanseye . the fllowing is beanseye config content:

servers:

  • localhost:7900 0 1 2
  • 127.0.0.1:7900 A -1 B

I could set :
servers:
192.168.1.3:7900
192.168.1.4 : 7900

My question is : how to set the servers options like '127.0.0.1:7900 A -1 B' ? how to set '0 1 2' and 'A -1 B' ? So that let the two beansdb backup each other like your architecture .

Thanks !

I want to upload img on the stress tests. I use the interface : "http://ip:port/upload",how to upload diffrent imgs to the server on the stress test?

I used ab for the upload function on the stress tests. I found that the ab can upload the same img file to the zimg server. like fllowing :
./ab -p "/home/eyes/1.gif" -T "gif" -n 100 -c 10 http://127.0.0.1:4869/upload
I found that I noly upload the same 1.gif 100 times to the zimg server. Is it right for the stress tests? So my question :

  1. Is the test result of this method same to that which upload 100 diffrent imgs to the zimg server? Did the zimg server handle the same imgs 100 times like 100 diffrent imgs?
  2. I found that you didn't test the upload interface for strees tests .Do you konw how to uploading diffrent imgs on the stress tests? Any good tools? Any good method?

关于MagickWand的库依赖

hello~我在 ubuntu server 12.04 以及 centos6 编译源码都遇到了类似于下边的问题

fatal error: wand/MagickWand.h: No such file or directory

imagemagick 我是按照官网编译源码安装的,我将Makefile修改一下之后可以正常编译: https://github.com/amyangfei/zimg/blob/modify_makefile/Makefile , 主要改了

LIBS = -levent -levent_openssl -levent_pthreads -lssl -lcrypto -levhtp **-lMagickWand-6.Q16** -lmemcached 

想请问你的开发环境里是不是export了环境变量和库的软链接,譬如

export C_INCLUDE_PATH=/usr/local/include/ImageMagick-6
ln -s /usr/local/lib/libMagickWand-6.Q16.so /usr/local/lib/libMagickWand.so  

谢谢 :)

GraphicsMagick for performance/stability

Since the focus of the project seems to be on speed and size it might be a good idea to investigate porting to http://www.graphicsmagick.org/index.html since they're very frequently updated, have public source control, and are specifically focusing on performance and stability. One thing to watch out for is the API, there might be some things that GM doesn't implement.

Written by C

This software is written in C,not written by C.

上传文件时Zimg 2.0 异常退出

OS env: Redhat 6.5

按照文档上的内容把Zimg 2.0安装好之后,在index.html里上传图片的实惠报以下的错误:

[root@156 bin]# ./zimg  conf/zimg.lua
*** glibc detected *** ./zimg: corrupted double-linked list: 0x00007f7e24001380 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3063676166]
/lib64/libc.so.6[0x3063678ef4]
./zimg(event_mm_free_+0x36)[0x43897e]
./zimg(evbuffer_decref_and_unlock_+0x1d1)[0x4222f2]
./zimg(evbuffer_free+0x3e)[0x422335]
./zimg[0x417648]
./zimg(evhtp_connection_free+0x16)[0x4177f6]
./zimg(bufferevent_run_writecb_+0xa2)[0x42981b]
./zimg[0x42e333]
./zimg[0x42e83c]
./zimg[0x432b9a]
./zimg[0x432e6b]
./zimg[0x43349f]
./zimg(event_base_loop+0x2a8)[0x433ba4]
./zimg[0x414352]
/lib64/libpthread.so.0[0x3063e079d1]
/lib64/libc.so.6(clone+0x6d)[0x30636e8b6d]

一直想有这么个东西,终于发现了

一直想有这么个东西,终于发现有人做了。
以前自己的想法是通过nginx来处理,后端让imagemagick去处理图片,终究是C功底不过关,没能实现。。

想问下,zimg请求的md5图片,除了原图,其它条件下的是即时生成响应请求的?还是第一次请求的时候生成,之后的访问直接输出已经生成的?如果是后者,如果控制生成的文件所占的空间?

make error when multi version of openssl library installed in system

If you installed more than one version of openssl library. CmakeList.txt in zimg cannot fit it correctly.
For example, CentOS has a low version openssl (found version "0.9.8e-rhel5") which cannot be used for build libevhtp. Then you install a new openssl by sourcecode. Error happens like this:

Scanning dependencies of target zimg
Linking C executable zimg
/usr/bin/ld: skipping incompatible /usr/lib/libssl.so when searching for -lssl
/usr/bin/ld: skipping incompatible /usr/lib/libssl.a when searching for -lssl
/usr/bin/ld: skipping incompatible /usr/lib/libcrypto.so when searching for -lcrypto
/usr/bin/ld: skipping incompatible /usr/lib/libcrypto.a when searching for -lcrypto
/usr/bin/ld: skipping incompatible /usr/lib/liblua-5.1.so when searching for -llua-5.1
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/local/lib/libevhtp.a(evhtp.c.o): In function `evhtp_ssl_init':
evhtp.c:(.text+0x1018): undefined reference to `EC_KEY_new_by_curve_name'
evhtp.c:(.text+0x1040): undefined reference to `EC_KEY_free'
/usr/local/lib/libevhtp.a(evhtp.c.o): In function `_evhtp_ssl_servername':
evhtp.c:(.text+0x4f7e): undefined reference to `SSL_get_servername'
evhtp.c:(.text+0x501c): undefined reference to `SSL_set_SSL_CTX'
/usr/local/lib/libevhtp.a(evhtp.c.o): In function `_evhtp_request_parser_hostname':
evhtp.c:(.text+0x5c99): undefined reference to `SSL_get_servername'
collect2: ld returned 1 exit status
make[2]: *** [zimg] Error 1
make[1]: *** [CMakeFiles/zimg.dir/all] Error 2
make: *** [all] Error 2

brew 安装报错

ApplematoMacBook:zimg apple$ make
mkdir -p build/zimg
cd build/zimg; cmake /Users/apple/work/local/zimg/src; make; cp zimg /Users/apple/work/local/zimg/bin
CMake Error at /usr/local/homebrew/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find LibEvent (missing: LIBEVENT_LIBRARY LIBEVENT_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/homebrew/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
CMakeModules/FindLibEvent.cmake:17 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:80 (find_package)

-- Configuring incomplete, errors occurred!
See also "/Users/apple/work/local/zimg/build/zimg/CMakeFiles/CMakeOutput.log".
See also "/Users/apple/work/local/zimg/build/zimg/CMakeFiles/CMakeError.log".
make[1]: *** No targets specified and no makefile found. Stop.
cp: zimg: No such file or directory
make: *** [all] Error 1

当上传一个破损的jpg文件的时候http服务器宕掉了

w020120210611376489131

上面的是一张破损的图片.
命令行中输出错误栈信息



 *** glibc detected *** ./zimg: double free or corruption (out): 0x00007f4c60000020 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x760e6)[0x7f4c77f0f0e6]
/lib64/libc.so.6(+0x78c13)[0x7f4c77f11c13]
./zimg(get_img+0x460)[0x409160]
./zimg(send_document_cb+0x751)[0x40cf21]
./zimg[0x4119b0]
./zimg(htparser_run+0xbfb)[0x41642b]
./zimg[0x412b61]
/usr/local/lib/libevent-2.0.so.5(+0x19ee5)[0x7f4c79027ee5]
/usr/local/lib/libevent-2.0.so.5(event_base_loop+0x53c)[0x7f4c7901fe0c]
./zimg[0x40f3a2]
/lib64/libpthread.so.0(+0x7851)[0x7f4c78233851]
/lib64/libc.so.6(clone+0x6d)[0x7f4c77f8190d]
======= Memory map: ========
00400000-00455000 r-xp 00000000 fd:02 50727537                           /home/zimg/zimg/bin/zimg
00655000-00656000 rw-p 00055000 fd:02 50727537                           /home/zimg/zimg/bin/zimg
00656000-00657000 rw-p 00000000 00:00 0
01f26000-01f47000 rw-p 00000000 00:00 0                                  [heap]
7f4c58000000-7f4c58021000 rw-p 00000000 00:00 0
7f4c58021000-7f4c5c000000 ---p 00000000 00:00 0
7f4c60000000-7f4c60087000 rw-p 00000000 00:00 0

compile error

[root@ccj zimg]# make
mkdir -p build/zimg
cd build/zimg; cmake /zimg/src; make; cp zimg /zimg/bin
Diabling SSL
Build Type: Release
Std CFLAGS:  -Wall -fno-strict-aliasing -DPROJECT_VERSION="2.0.0" -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -DEVHTP_DISABLE_SSL -DNDEBUG -DZIMG_VERSION=2.0.0 -DMAGICKCORE_HDRI_ENABLE -DMAGICKCORE_QUANTUM_DEPTH=16
Dbg CFLAGS: -g -Wall -fno-strict-aliasing -ggdb -DDEBUG -DZIMG_VERSION=2.0.0 -DMAGICKCORE_HDRI_ENABLE -DMAGICKCORE_QUANTUM_DEPTH=16
Rel CFLAGS: -O3 -DNDEBUG -Wall -fno-strict-aliasing -DZIMG_VERSION=2.0.0 -DMAGICKCORE_HDRI_ENABLE -DMAGICKCORE_QUANTUM_DEPTH=16
-- Configuring done
-- Generating done
-- Build files have been written to: /zimg/build/zimg
make[1]: Entering directory `/zimg/build/zimg'
make[2]: Entering directory `/zimg/build/zimg'
make[3]: Entering directory `/zimg/build/zimg'
make[3]: Leaving directory `/zimg/build/zimg'
make[3]: Entering directory `/zimg/build/zimg'
Linking C executable zimg
CMakeFiles/zimg.dir/main.c.o: In function `main':
main.c:(.text+0x716): undefined reference to `luaL_loadfilex'
main.c:(.text+0x732): undefined reference to `lua_pcallk'
main.c:(.text+0x747): undefined reference to `lua_getglobal'
main.c:(.text+0x776): undefined reference to `lua_getglobal'
main.c:(.text+0x7a5): undefined reference to `lua_getglobal'
main.c:(.text+0x7d4): undefined reference to `lua_getglobal'
main.c:(.text+0x803): undefined reference to `lua_getglobal'
CMakeFiles/zimg.dir/main.c.o:main.c:(.text+0x832): more undefined references to `lua_getglobal' follow
CMakeFiles/zimg.dir/main.c.o: In function `main':
main.c:(.text+0xdfb): undefined reference to `lua_tonumberx'
main.c:(.text+0xe43): undefined reference to `lua_tonumberx'
main.c:(.text+0xe93): undefined reference to `lua_tonumberx'
main.c:(.text+0xf33): undefined reference to `lua_tonumberx'
main.c:(.text+0xf5b): undefined reference to `lua_tonumberx'
CMakeFiles/zimg.dir/main.c.o:main.c:(.text+0xf83): more undefined references to `lua_tonumberx' follow
collect2: ld returned 1 exit status
make[3]: *** [zimg] Error 1
make[3]: Leaving directory `/zimg/build/zimg'
make[2]: *** [CMakeFiles/zimg.dir/all] Error 2
make[2]: Leaving directory `/zimg/build/zimg'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/zimg/build/zimg'
cp: cannot stat `zimg': No such file or directory
make: *** [all] Error 1
[root@ccj zimg]# gcc --version
gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ResizeFilter Error

In some system there is a warning like this:

AcquireResizeFilter: Assertion `UndefinedFilter < filter && filter < SentinelFilter' failed.

authentication lua script possible?

I really like zimg just that the authentication...

would like the lua script to detect cookies... if cookies match, then allow upload. that's all, returning the filenames of the uploaded data to server.

zimg TODO list

zimg在设计开发阶段需求基本是我一个毫无实战经验的人凭空想出来的,用起来肯定各种不顺手,所以开一个issue,如果你期望在使用zimg的任何环节增加功能,请在此处回复,我将酌情加入。

w=g&h=w

这是虾米情况。。。。

<title>Love is Eternal</title>

Single1024

Since 2008-12-22, there left no room in my heart for another one.
since commit 97076cd

关于zcache.c的缓存部分的问题

请教楼主
关于zcache.c的缓存模块。
当对某个原图进行裁剪后,裁剪后的小图是被缓存的,缓存的形式是什么?直接缓存文件还是将文件保存到硬盘上,缓存里面只存储地址。

如果是将加工的图片保存到磁盘上的话,那么这些文件需要删除吗?删除的策略是什么?

你好,用php curl上传图片到zimg该如何获取json返回数据?

我用php curl上传图片成功了,可一直返回html格式,根据文档说的row_post方式,可查询资料php里面没有这个,一直尝试了多次,还是没有成功,特此求解,希望作者能提供几门语言的api上传接口,目前只提供一些curl命令行接口,谢谢

boundary定位到了,但是pattern居然神奇的最后多了一个E

2014/04/25 15:09:53:278763 Thread ID: 140074436028160 [INFO] /usr/local/src/zimg/zhttpd.c:215 post_request_cb() Method: 2
2014/04/25 15:09:53:278900 Thread ID: 140074436028160 [INFO] /usr/local/src/zimg/zhttpd.c:262 post_request_cb() boundary Find. boundary = 0xKhTmLbOuNdArY-09BB7BC0-B667-4B30-AE96-8F69FFA5737A
2014/04/25 15:09:53:278929 Thread ID: 140074436028160 [INFO] /usr/local/src/zimg/zhttpd.c:279 post_request_cb() evblen = 8480
2014/04/25 15:09:53:278957 Thread ID: 140074436028160 [INFO] /usr/local/src/zimg/zhttpd.c:281 post_request_cb() rmblen = 8480
2014/04/25 15:09:53:278983 Thread ID: 140074436028160 [INFO] /usr/local/src/zimg/zhttpd.c:296 post_request_cb() boundaryPattern =
--0xKhTmLbOuNdArY-09BB7BC0-B667-4B30-AE96-8F69FFA5737AE, strlen = 58

about zimg cluster ,there are some questions.

I want to use zimg cluster. I used 3 zimg servers and used 3 local disk to store imgs.It means that one zimg server has one disk. After I knowed about the design and architecture of zimg ,I have some questions:

  1. about the load balancing :
    I saw that the picture of architecture used LVS for load balancing, Could I use Nginx instand of LVS ? When I used Nginx for load balancing ,I find one question : which zimg server should I upload to ? There are 3 zimg server ,I could not control where uploading the img . So that I don't konw that which zimg server to access the img on the disk. The very import question is that I don't know how to set the hash rule for uploading to the zimg server. I could not do any thing for The process of uploading img.
  2. about the HA :
    I need to do HA for zimg server. How to do that for zimg server?Could you give me some suggestions?
  3. The zimg support memcached ,Could I use memcached cluster instand of the single memcached?

4.The beansdb supports memcached protocol, it means that I could use memcaced instand of it ,isn't it? The SSDB supports redis protocol ,it means that I could use redist instand of it ,isn't it?
5. Do you have some good ideas about the zimg cluster? So that let the server is stronger and better.

编译zimg时错误

$ cd zimg
$ sudo make # then show errors...

-- Configuring incomplete, errors occurred!
make[1]: Entering directory `/root/zimg/build/zimg'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/root/zimg/build/zimg'
cp: cannot stat `zimg': No such file or directory
make: *** [all] Error 1

怎么加入依赖的包?

问个新手问题,怎么把包include进去编译?
我make的时候遇到这个问题:(依赖的库在zimg的同级目录)
“./zhttpd.h:25:10: fatal error: 'evhtp.h' file not found”
之前只用java,最近用go。没有用过c的依赖库编译。

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.