From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: GDI+ take 3 Date: Thu, 16 Apr 2020 13:04:19 +0300 Message-ID: <83sgh3eogs.fsf@gnu.org> References: <86h7xzc5ai.fsf@csic.es> <83d08mt7gy.fsf@gnu.org> <83eesrkivc.fsf@gnu.org> <865ze3wvk8.fsf@csic.es> <837dyihyjc.fsf@gnu.org> <877dyh28ci.fsf@tcd.ie> <83o8rthnvr.fsf@gnu.org> <87zhbdwx1c.fsf@tcd.ie> <83mu7dgtls.fsf@gnu.org> <83a73chmrl.fsf@gnu.org> <831roohlgw.fsf@gnu.org> <83y2qwg673.fsf@gnu.org> <83v9m0g4yw.fsf@gnu.org> <83sgh4g3af.fsf@gnu.org> <83k12gfzxc.fsf@gnu.org> <83eesofyac.fsf@gnu.org> <83d088fwgt.fsf@gnu.org> <835ze0fqk2.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="118216"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juanjose.garciaripoll@gmail.com, emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 16 12:05:12 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jP1OS-000Uf7-6P for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Apr 2020 12:05:12 +0200 Original-Received: from localhost ([::1]:60236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jP1OR-0004hq-7r for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Apr 2020 06:05:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59731) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jP1Ns-00043q-1Q for emacs-devel@gnu.org; Thu, 16 Apr 2020 06:04:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jP1Nr-0002F8-Ty; Thu, 16 Apr 2020 06:04:35 -0400 Original-Received: from [176.228.60.248] (port=2519 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jP1Nq-0004IN-F0; Thu, 16 Apr 2020 06:04:35 -0400 In-Reply-To: (message from Juanma Barranquero on Wed, 15 Apr 2020 22:31:40 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:247077 Archived-At: > From: Juanma Barranquero > Date: Wed, 15 Apr 2020 22:31:40 +0200 > Cc: juanjose.garciaripoll@gmail.com, Emacs developers > > 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 https://www.nightprogrammer.org/development/multipage-tiff-example-download-test-image-file/) 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...