Closed akaml closed 5 months ago
Thanks for the excellent, clear report!
One of the reproduction options is to load an image from a file(via the bitmap function) or to call already defined bitmap image in the repl. If you create images using the functions of forming simple shapes (rect, circle, etc.), then the shapes are displayed correctly, the problem arises with bitmap.
I checked the image cache and found an svg file with a bitmap embedded via base64. It seems that there is a problem with the display itself in emacs.
Interesting! Thank you for narrowing that down.
Although I can't reproduce this (I do see the image) on Emacs 28.2 on Linux, you're using Windows.
I'll try Windows, later; assuming I can reproduce it there: This seems specific to the Windows version of Emacs -- it has some problem handling SVGs with embedded bitmaps?
If so, this might need to get fixed, properly, in Emacs for Windows. But maybe there is some work-around I can supply for you meanwhile??
Quick background about the image handling:
Currently the Racket Mode back end uses Racket's file/convertible
to convert image objects. It asks for SVG when the Emacs front end reports 'svg
in both the image-types
and image-types-available-p
lists. Otherwise it asks for PNG. (The preference for SVG is because it can be much smaller/faster for vector graphics. See e.g. #470. And with no downside for bitmap graphics... usually.)
There's no option to prefer PNG exposed, for you to try here. I could add something like that. However, even if it helps work around this shortcoming in Emacs for Windows, it would be at the cost of bloating graphics handling generally. So... I'm not immediately sure what's best to do...
Thanks for the answer! Apparently, the problem is with the emacs build. I used vanilla versions of emacs from the gnu website (tested on versions 28 and 29), but after installing via msys2, the problem went away At first I thought that the problem was in imagemagick, but it turned out that the msys2 version was built without its support. Support for image types: image-types => emacs 28.2(vanila): (svg png gif tiff jpeg xpm xbm ppm) emacs 29.3(msys2): (bmp svg webgl png gif tiff jpeg xpm xbm ppm) Of the interesting differences, I can only notice the lack of bmp support in the vanilla version I also had a problem opening images embedded in svg outside of racket-mode on vanilla versions
@greghendershott
FYI: I ran the code from the issue-709 branch - the problem on the vanilla version is fixed when (setq racket-images-do-not-use-svg t)
. Thanks!
Support for image types: image-types => emacs 28.2(vanila): (svg png gif tiff jpeg xpm xbm ppm) emacs 29.3(msys2): (bmp svg webgl png gif tiff jpeg xpm xbm ppm)
Interesting; so the problematic version advertises itself as supporting svg
-- and does generally for vector ops -- but apparently there's a hole in the implementation where it doesn't support embedded bitmaps.
FYI: I ran the code from the issue-709 branch - the problem on the vanilla version is fixed when
(setq racket-images-do-not-use-svg t)
. Thanks!
Great. I'll merge that.
Aside from being a work-around for this specific case, this might be useful for anyone who can't use or prefers not to use svg.
Hi. I have a problem with displaying bitmap images in repl when using #lang htdp/bsl. One of the reproduction options is to load an image from a file(via the bitmap function) or to call already defined bitmap image in the repl If you create images using the functions of forming simple shapes (rect, circle, etc.), then the shapes are displayed correctly, the problem arises with bitmap. I checked the image cache and found an svg file with a bitmap embedded via base64. It seems that there is a problem with the display itself in emacs. I tried different versions of racket - the problem remains The code for reproduction: issue.txt
Package
System values
Buffer values
Racket Mode values
Minor modes
Disabled minor modes