# HttpImageFilterModule: Crop with nonzero origin

**URL:** <https://www.ruby-forum.com/t/httpimagefiltermodule-crop-with-nonzero-origin/207617>\
**Category:** NGINX\
**Created:** [May 30, 2011, 9:32am UTC](https://www.ruby-forum.com/t/httpimagefiltermodule-crop-with-nonzero-origin/207617 "2011-05-30T09:32:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 30, 2011, 9:32am UTC](https://www.ruby-forum.com/t/httpimagefiltermodule-crop-with-nonzero-origin/207617/1 "2011-05-30T09:32:38Z")

</div>

I’d like to use nginx’s Image Filter  
Module[http://wiki.nginx.org/HttpImageFilterModule](http://wiki.nginx.org/HttpImageFilterModule)to dynamically  
generate  
DeepZoom[http://msdn.microsoft.com/en-us/library/cc645050(v=vs.95).aspx](http://msdn.microsoft.com/en-us/library/cc645050%28v=vs.95%29.aspx)images.

However, I don’t see an x-position or y-position argument for the crop  
directive. Is it even possible for the Image Filter Module to crop  
quadrants  
other than the top left?

David

---

<div class="post-metadata">

**Author:** ![David\_Somers-Harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@David\_Somers-Harris](https://www.ruby-forum.com/u/David_Somers-Harris)\
**Post date:** [May 30, 2011, 11:50am UTC](https://www.ruby-forum.com/t/httpimagefiltermodule-crop-with-nonzero-origin/207617/2 "2011-05-30T11:50:29Z")

</div>

Hello!

On Mon, May 30, 2011 at 04:32:19PM +0900, David Somers-Harris wrote:

> I’d like to use nginx’s Image Filter  
> Module[http://wiki.nginx.org/HttpImageFilterModule](http://wiki.nginx.org/HttpImageFilterModule)to dynamically  
> generate

DeepZoom[http://msdn.microsoft.com/en-us/library/cc645050(v=vs.95).aspx](http://msdn.microsoft.com/en-us/library/cc645050%28v=vs.95%29.aspx)images.

> However, I don’t see an x-position or y-position argument for the crop  
> directive. Is it even possible for the Image Filter Module to crop quadrants  
> other than the top left?

Just a side note: “crop” isn’t really crop, it is something like  
“resize and crop if needed”.

And no, it doesn’t allow to crop image to arbitrary selected region.

Maxim D.

---

<div class="post-metadata">

**Author:** ![David\_Somers-Harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@David\_Somers-Harris](https://www.ruby-forum.com/u/David_Somers-Harris)\
**Post date:** [May 31, 2011, 9:22am UTC](https://www.ruby-forum.com/t/httpimagefiltermodule-crop-with-nonzero-origin/207617/3 "2011-05-31T09:22:19Z")

</div>

Ah I see. Too bad.

When the Image Filter Module crops, does it crop out the right and  
bottom  
ends only, or does it evenly crop the top, left, right and bottom out?

David

---

<div class="post-metadata">

**Author:** ![David\_Somers-Harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@David\_Somers-Harris](https://www.ruby-forum.com/u/David_Somers-Harris)\
**Post date:** [May 31, 2011, 9:40am UTC](https://www.ruby-forum.com/t/httpimagefiltermodule-crop-with-nonzero-origin/207617/4 "2011-05-31T09:40:53Z")

</div>

On Tue, May 31, 2011 at 04:21:57PM +0900, David Somers Harris wrote:

> Ah I see. Too bad.
> 
> When the Image Filter Module crops, does it crop out the right and bottom  
> ends only, or does it evenly crop the top, left, right and bottom out?

It tries to keep as much as possible of an original image:  
The image is scaled on one dimension and then is croped on other  
dimension.

–  
Igor S.
