GNU bug report logs - #59075
29.0.50; Image transforms not applied to svg images

Previous Next

Package: emacs;

Reported by: Evgeny Zajcev <lg.zevlg <at> gmail.com>

Date: Sun, 6 Nov 2022 10:17:02 UTC

Severity: normal

Found in version 29.0.50

Done: Po Lu <luangruo <at> yahoo.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Evgeny Zajcev <lg.zevlg <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 59075 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, Stephen Berman <stephen.berman <at> gmx.net>
Subject: bug#59075: 29.0.50; Image transforms not applied to svg images
Date: Sat, 12 Nov 2022 12:48:40 +0300
[Message part 1 (text/plain, inline)]
пн, 7 нояб. 2022 г. в 15:24, Po Lu <luangruo <at> yahoo.com>:

> Evgeny Zajcev <lg.zevlg <at> gmail.com> writes:
>
> > пн, 7 нояб. 2022 г. в 03:26, Po Lu <luangruo <at> yahoo.com>:
> >
> >  My suspicion is that librsvg is not being used to display SVGs at all,
> >  on Mac OS 13.  What happens if you build without native image APIs?
> >
> > Works perfectly without native image API!  Resulting svg image gets
> correct size after applying `:height',
> > and if I change image type to png, image is not displayed at all as
> expected.
>
> Scratch what I said earlier.  Does this fix the problem?
>
> diff --git a/src/nsimage.m b/src/nsimage.m
> index 9cb5090dd0..dd8768664a 100644
> --- a/src/nsimage.m
> +++ b/src/nsimage.m
> @@ -74,8 +74,10 @@ Updated by Christian Limpach (chris <at> nice.ch)
>      imageType = @"com.compuserve.gif";
>    else if (EQ (type, Qtiff))
>      imageType = @"public.tiff";
> +#ifndef HAVE_RSVG
>    else if (EQ (type, Qsvg))
>      imageType = @"public.svg-image";
> +#endif
>    else if (EQ (type, Qheic))
>      imageType = @"public.heic";
>
>
>
Adding this code fixes the problem!  However, if I specify `png' image type
instead of `svg' when svg image is in use, no error is triggered in
contrast with Emacs without native images.

If this code does not break anything on older MacOS I think it should be
added to Emacs.

If rsvg is present, there is no point in using native image APIs, as
> they do not scale SVG images nearly as well.  And this part of
> image_set_transform gets in the way:
>
> #ifdef HAVE_RSVG
>   /* SVGs are pre-scaled to the correct size.  */
>   if (EQ (image_spec_value (img->spec, QCtype, NULL), Qsvg))
>     {
>       width = img->width / FRAME_SCALE_FACTOR (f);
>       height = img->height / FRAME_SCALE_FACTOR (f);
>     }
>   else
> #endif
>


-- 
lg
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.