﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3650	Image size off-by-one error with_GDIPlus_ImageResize	anonymous	Jpm	"The function _GDIPlus_ImageResize creates images that seem to have an off-by-one error regarding the size of the source image placement inside the destination bitmap.

Please see the attached images.  The code below was used to up-scale TestImage.png to TestResult.png, and then TestResult.png was viewed in Paint.Net.  In the screenshot for Paint.Net you can clearly see the resulting image has a transparent border showing through along the right and bottom edges, while the left and top edges appear as they should.  While the resulting image is the correct number of pixels overall, the content inside is slightly small, although not obvious since the missing part is transparent.

This seems to suggest the source image was placed into the destination image with the bottom right coordinates specified one x pixel and one y pixel less than ideal.

Test Code:

#include <GDIPlus.au3>
_GDIPlus_Startup()
Local $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & ""\TestImage.png"")
Local $iWidth = _GDIPlus_ImageGetWidth($hImage)
Local $iHeight = _GDIPlus_ImageGetHeight($hImage)
Local $hBitmap = _GDIPlus_ImageResize( _
    $hImage, $iWidth * 4, $iHeight * 4, _
    $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC)
_GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & ""\TestResult.png"")
Sleep(500)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()

See also (somewhat) related ticket # 3647
"	Bug	closed		Standard UDFs	3.3.14.0	None	Fixed		
