Subject: bug#68452: w32-use-native-image-API makes weird behavior

From: Eli Zaretskii <[email-masked]>
Date: Sun, 14 Jan 2024 18:34:04 +0200

> Date: Sun, 14 Jan 2024 21:52:00 +0800
> From: Jinsong Zhao <[email-masked]>
> 
> I am not a skilled Emacs user. I mainly use Emacs as a front end for Maxima with the help of
> imaxima. imaxima converts Maxima output into PNG image, which are then displayed in Emacs. I am
> using Windows 10.
> 
> It works fine on Emacs 28.2, when I type an expression, e.g. q^2 = 1; and return, Emacs 28.2
> immediately displays the resulting PNG image. 
> 
> If I use Emacs 29.1, however, all I get after returning is an empty square. And if I type another
> expression and return, a blank square appears. At the same time, the first empty square was
> replaced by a PNG image of the first expression. That's weird. 
> 
> I saw the following messages in the *Messages* buffer: 
> 
> Processing Maxima output...done 
> Unable to load image (image :type png :file c:/Users/Jinso/AppData/Local/Temp/imaximatU5Y9B/1 :
> scale 1.001595744680851 :ascent center :mask (heuristic (color-values imaxima-bg-color)) :
> transform-smoothing t) [35 times] 
> Process imaxima finished 
> 
> After (setq w32-use-native-image-API nil), imaxima has the same behaviour on Emacs 28.2 and
> 29.1.

Thanks, but we'd need an example of such a PNG image to investigate.
Can you send one such image, which works with w32-use-native-image-API
nil, but not when it is non-nil?

In any case, it is perfectly okay to reset w32-use-native-image-API to
nil if the native image APIs fail to process an image you want to see.
That's why we support both modes.