[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDI+ take 3

From: Eli Zaretskii
Subject: Re: GDI+ take 3
Date: Thu, 16 Apr 2020 13:04:19 +0300

> From: Juanma Barranquero <address@hidden>
> Date: Wed, 15 Apr 2020 22:31:40 +0200
> Cc: address@hidden, Emacs developers <address@hidden>
> I just tested with a much smaller GIF image (20 KiB, vs 4 MiB of the other 
> test image), and the result is the
> same:
> - Loads correctly
> - Hitting RET animates the image for a short while, then jumps back to the 
> first image and stops.
> - Hitting RET a second time animates the image correctly, and it stops at the 
> last frame.

I spent some time trying to make this code work reliably on my XP
system here, but finally gave up.  This mail is mainly a record of
what I tried and what I observed.

The GdipImageGetFrameCount call always returns status = Win32Error
here, for any image file I tried to load.  I have no idea why.  I
added code to work around that by calling GdipGetPropertyItem and then
using the propertyItem[0].length member, but then
GdipImageGetFrameCount began mysteriously to succeed (?? which already
smells of some bug somewhere), and w32_select_active_frame started
behaving erratically: various local variables change values during the
execution of the function, GDI+ calls sometimes return
status = InvalidParameter, etc.  Those are telltale signs of some code
smashing the stack, but I couldn't spot any source-level problems.  So
I ended up tossing that workaround code, as it doesn't seem to improve
the situation, maybe even make it worse.

In addition, multi-page TIFF files I tried (from
fail to load: GdipCreateBitmapFromFile returns status = InvalidParameter,
for no clear reason.  Single-page TIFF images do load successfully.

I guess I'm missing something here, or maybe I'm just too stupid for
this stuff, sigh...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]