all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Evgeny Zajcev <lg.zevlg@gmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: 59075@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	Stephen Berman <stephen.berman@gmx.net>
Subject: bug#59075: 29.0.50; Image transforms not applied to svg images
Date: Sat, 12 Nov 2022 12:48:40 +0300	[thread overview]
Message-ID: <CAO=W_Zr5dCT1rAmhrezkh8t4dHJWdZWSLQB08tbfotDgkQ-ZtQ@mail.gmail.com> (raw)
In-Reply-To: <877d077y1m.fsf@yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

пн, 7 нояб. 2022 г. в 15:24, Po Lu <luangruo@yahoo.com>:

> Evgeny Zajcev <lg.zevlg@gmail.com> writes:
>
> > пн, 7 нояб. 2022 г. в 03:26, Po Lu <luangruo@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@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

[-- Attachment #2: Type: text/html, Size: 2802 bytes --]

  reply	other threads:[~2022-11-12  9:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-06 10:16 bug#59075: 29.0.50; Image transforms not applied to svg images Evgeny Zajcev
2022-11-06 11:02 ` Eli Zaretskii
2022-11-06 11:52   ` Evgeny Zajcev
2022-11-06 12:33     ` Eli Zaretskii
2022-11-06 13:02       ` Stephen Berman
2022-11-06 16:07         ` Evgeny Zajcev
2022-11-06 16:50           ` Stephen Berman
2022-11-07  0:26             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-07 10:26               ` Evgeny Zajcev
2022-11-07 12:21                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-07 12:24                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-12  9:48                   ` Evgeny Zajcev [this message]
2022-11-12 11:04                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-13  8:57                       ` Evgeny Zajcev
2022-11-13  9:31                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO=W_Zr5dCT1rAmhrezkh8t4dHJWdZWSLQB08tbfotDgkQ-ZtQ@mail.gmail.com' \
    --to=lg.zevlg@gmail.com \
    --cc=59075@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.