summaryrefslogtreecommitdiff
path: root/src/http/modules
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-05-10 12:27:59 +0000
committerJonathan Kolb <jon@b0g.us>2011-05-10 12:27:59 +0000
commit1b122b0876a0f0e1efcb4be6d730f353b04759ea (patch)
tree58497c7a5811e177d11558dc83ae728d5ad2f9fc /src/http/modules
parenta6bc51d66d27bb318bfb1d4139e72cb61c7151a6 (diff)
downloadnginx-1b122b0876a0f0e1efcb4be6d730f353b04759ea.tar.gz
Changes with nginx 1.0.2 10 May 2011v1.0.2
*) Feature: now shared zones and caches use POSIX semaphores. *) Bugfix: in the "rotate" parameter of the "image_filter" directive. Thanks to Adam Bocim. *) Bugfix: nginx could not be built on Solaris; the bug had appeared in 1.0.1.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_image_filter_module.c20
-rw-r--r--src/http/modules/perl/nginx.pm2
2 files changed, 18 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_image_filter_module.c b/src/http/modules/ngx_http_image_filter_module.c
index ecbfd158b..dd3803fe3 100644
--- a/src/http/modules/ngx_http_image_filter_module.c
+++ b/src/http/modules/ngx_http_image_filter_module.c
@@ -723,7 +723,7 @@ ngx_http_image_size(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
static ngx_buf_t *
ngx_http_image_resize(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
{
- int sx, sy, dx, dy, ox, oy, size,
+ int sx, sy, dx, dy, ox, oy, ax, ay, size,
colors, palette, transparent,
red, green, blue, t;
u_char *out;
@@ -852,6 +852,9 @@ transparent:
if (ctx->angle) {
src = dst;
+ ax = (dx % 2 == 0) ? 1 : 0;
+ ay = (dy % 2 == 0) ? 1 : 0;
+
switch (ctx->angle) {
case 90:
@@ -861,7 +864,17 @@ transparent:
gdImageDestroy(src);
return NULL;
}
- gdImageCopyRotated(dst, src, dy/2, dx/2, 0, 0, dx, dy, ctx->angle);
+ if (ctx->angle == 90) {
+ ox = dy / 2 + ay;
+ oy = dx / 2 - ax;
+
+ } else {
+ ox = dy / 2 - ay;
+ oy = dx / 2 + ax;
+ }
+
+ gdImageCopyRotated(dst, src, ox, oy, 0, 0,
+ dx + ax, dy + ay, ctx->angle);
gdImageDestroy(src);
t = dx;
@@ -875,7 +888,8 @@ transparent:
gdImageDestroy(src);
return NULL;
}
- gdImageCopyRotated(dst, src, dx/2, dy/2, 0, 0, dx, dy, ctx->angle);
+ gdImageCopyRotated(dst, src, dx / 2 - ax, dy / 2 - ay, 0, 0,
+ dx + ax, dy + ay, ctx->angle);
gdImageDestroy(src);
break;
}
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 098d45b47..bc9790193 100644
--- a/src/http/modules/perl/nginx.pm
+++ b/src/http/modules/perl/nginx.pm
@@ -48,7 +48,7 @@ our @EXPORT = qw(
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '1.0.1';
+our $VERSION = '1.0.2';
require XSLoader;
XSLoader::load('nginx', $VERSION);