summaryrefslogtreecommitdiff
path: root/plugins/AdvaImg/src/main.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-05-24 17:02:28 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-05-24 17:02:28 +0000
commitc2dd106d2da0d6c0118662efe485135150c0de41 (patch)
treee80512abf191cec36e67f6a9be52ac5d7c397bcc /plugins/AdvaImg/src/main.cpp
parent09cb37f721442717a5668594d140f5ebca42006e (diff)
AdvaImg: fixed image loading without size restriction
AVS: fixed avatar coordinates git-svn-id: http://svn.miranda-ng.org/main/trunk@13816 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AdvaImg/src/main.cpp')
-rw-r--r--plugins/AdvaImg/src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/AdvaImg/src/main.cpp b/plugins/AdvaImg/src/main.cpp
index f522f8b499..5ba893dd51 100644
--- a/plugins/AdvaImg/src/main.cpp
+++ b/plugins/AdvaImg/src/main.cpp
@@ -214,8 +214,8 @@ static INT_PTR serviceBmpFilterResizeBitmap(WPARAM wParam,LPARAM lParam)
ResizeBitmap *info = (ResizeBitmap *) wParam;
if (info == NULL || info->size != sizeof(ResizeBitmap)
- || info->hBmp == NULL || info->max_width <= 0
- || info->max_height <= 0
+ || info->hBmp == NULL
+ || info->max_width < 0 || info->max_height < 0
|| (info->fit & ~RESIZEBITMAP_FLAG_DONT_GROW) < RESIZEBITMAP_STRETCH
|| (info->fit & ~RESIZEBITMAP_FLAG_DONT_GROW) > RESIZEBITMAP_MAKE_SQUARE)
return 0;
@@ -225,8 +225,8 @@ static INT_PTR serviceBmpFilterResizeBitmap(WPARAM wParam,LPARAM lParam)
// Calc final size
GetObject(info->hBmp, sizeof(bminfo), &bminfo);
- width = info->max_width;
- height = info->max_height;
+ width = info->max_width == 0 ? bminfo.bmWidth : info->max_width;
+ height = info->max_height == 0 ? bminfo.bmHeight : info->max_height;
xOrig = 0;
yOrig = 0;