image_filter and then save it for cache

smoothdvd nginx-forum at nginx.us
Thu Dec 9 10:19:52 MSK 2010


I want to keep image_filter's result to harddrive, and any one can help
me to do it? Now I can only resize the original image.

Following code only does resize.

# image resize
location /pic {
root /Users/alexgao/linux/web/dskb.cn;
try_files $uri @resize_pic;
}

location @resize_pic {
root /Users/alexgao/linux/web/dskb.cn;
if ($request_filename ~ [a-zA-Z0-9\-]+_([0-9]+)x([0-9]+).jpg) {
set $img_width $1;
set $img_height $2;
rewrite ^(.*)_[0-9]+x[0-9]+.jpg$ $1.jpg break;
}
image_filter resize $img_width $img_height;
image_filter_buffer 1M;
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_temp_path /Users/alexgao/linux/web/dskb.cn;
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,157065,157065#msg-157065




More information about the nginx mailing list