Jump to content

GDIplus error in Version 3.3.14.3


 Share

Recommended Posts

Hi there,

after installing the latest version I had to recompile a script which uses GDIplus-function to copy and resize images (jpg to bmp).

I noticed that the new executable works no longer and started searching for the problem, which I found in  function "_GDIPlus_EncodersGetCLSID()":  it does not longer return a CLSID, so saving the output file can't be done (using "_GDIPlus_ImageSaveToFile" instead of "_GDIPlus_ImageSaveToFileEx" doesn't help, because it's internal CLSID-call doesn't return a CLISD, too).

I reinstalled all versions back to 3.3.14.0, but they all work correct.

Here's the relevant part of my code - extended with a debug output (_mbinfo):

If Not @Compiled Then _consoleWrite("drawImage " & $iW & "x" & $iH)
    If _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImageIn, 0, 0, $iW, $iH) = False Then
        _gdiImageCopyCleanup($hImageOut, $hImageIn, $hGraphic, $hBMP)
        Return SetError(-14, 0, False)
    EndIf
    $CLSID = _GDIPlus_EncodersGetCLSID($ext)
    _mbInfo("HWND=" & $hImageOut & @CRLF & "OUTFILE=" & $sOutImage & @CRLF & "FUNC-CLSID=" & $CLSID & @CRLF & _
            "GDI_EXTRACTED_EXT= " & __GDIPlus_ExtractFileExt($sOutImage) & @CRLF & _
            "GDI-CLSID=" & _GDIPlus_EncodersGetCLSID(__GDIPlus_ExtractFileExt($sOutImage)))
    If $CLSID = "" Then
        _gdiImageCopyCleanup($hImageOut, $hImageIn, $hGraphic, $hBMP)
        Return SetError(-15, 0, False)
    EndIf
    If _GDIPlus_ImageSaveToFileEx($hImageOut, $sOutImage, $CLSID) = False Then
        _gdiImageCopyCleanup($hImageOut, $hImageIn, $hGraphic, $hBMP)
        Return SetError(-16, 0, False)
    EndIf
    _gdiImageCopyCleanup($hImageOut, $hImageIn, $hGraphic, $hBMP)
    If Not @Compiled Then _consoleWrite("End _GDIimageCopy2.")

The debug output (contains GDI handle, output file, returned CLSID from my code, native extracted extension and CLSID from GDI-include) returns from v 3.3.14.0 to 3.3.14.2 valid output, e.g.

HWND=0x067F2F70
OUTFILE=D:\temp\test.bmp
FUNC-CLSID={557CF400-1A04-11D3-9A73-0000F81EF32E}
GDI_EXTRACTED_EXT= bmp
GDI-CLSID={557CF400-1A04-11D3-9A73-0000F81EF32E}

After installing current version 3.3.14.3 the message box only returns

HWND=0x04A12F70
OUTFILE=D:\temp\test.bmp
FUNC-CLSID=
GDI_EXTRACTED_EXT= bmp
GDI-CLSID=

Is this a problem of the new version or can anybody give me a hint to keep my code running in the latest autoit-version.

Thanks

kara2004

 

 

 

Link to comment
Share on other sites

  • Moderators

kara2004,

You particularly need the WinAPIConv file.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hi Melba23,

checked out the new version with the fixed include files - image copy now works fine.

New versions always bring bugs with them, so no apologies needed (mea culpa, too - didn't recognize the "3.3.14.3 Fixes"-post from you).

Thanks to you for your quick solution and greetings to you and all who keep AutoIt running.

 

 

kara2004

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...