diff options
| author | Alan Third | 2023-09-11 19:58:14 +0100 |
|---|---|---|
| committer | Alan Third | 2023-09-13 20:19:44 +0100 |
| commit | 6cc6455e931913e42ef844c4a7d6ddcd0bf53788 (patch) | |
| tree | 5a32100fd6fcb6fb15c17b0501b05c3517573be4 /src | |
| parent | 9396d73942e0c912d978c25f9883e51668d33255 (diff) | |
| download | emacs-6cc6455e931913e42ef844c4a7d6ddcd0bf53788.tar.gz emacs-6cc6455e931913e42ef844c4a7d6ddcd0bf53788.zip | |
Fix SVG colors (bug#56182)
* src/image.c (svg_load_image): Reverse the R and B bytes in the
Windows colors before using them to generate the SVG.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c index 8ee802a9d62..c717ac88dca 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -11423,6 +11423,18 @@ svg_load_image (struct frame *f, struct image *img, char *contents, | |||
| 11423 | img->background_valid = 1; | 11423 | img->background_valid = 1; |
| 11424 | } | 11424 | } |
| 11425 | 11425 | ||
| 11426 | #if HAVE_NTGUI | ||
| 11427 | /* Windows stores the image colours in BGR format, and SVG expects | ||
| 11428 | them in RGB. */ | ||
| 11429 | foreground = (foreground & 0x0000FF) << 16 | ||
| 11430 | | (foreground & 0xFF0000) >> 16 | ||
| 11431 | | (foreground & 0x00FF00); | ||
| 11432 | |||
| 11433 | background = (background & 0x0000FF) << 16 | ||
| 11434 | | (background & 0xFF0000) >> 16 | ||
| 11435 | | (background & 0x00FF00); | ||
| 11436 | #endif | ||
| 11437 | |||
| 11426 | wrapped_contents = xmalloc (buffer_size); | 11438 | wrapped_contents = xmalloc (buffer_size); |
| 11427 | 11439 | ||
| 11428 | if (buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper, | 11440 | if (buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper, |