# Image\_filter and then save it for cache

**URL:** <https://www.ruby-forum.com/t/image-filter-and-then-save-it-for-cache/200320>\
**Category:** NGINX\
**Created:** [December 9, 2010, 8:21am UTC](https://www.ruby-forum.com/t/image-filter-and-then-save-it-for-cache/200320 "2010-12-09T08:21:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [December 9, 2010, 8:21am UTC](https://www.ruby-forum.com/t/image-filter-and-then-save-it-for-cache/200320/1 "2010-12-09T08:21:23Z")

</div>

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:

> **[image\_filter and then save it for cache](https://forum.nginx.org/read.php?2,157065,157065#msg-157065)**
>
> 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 @res
