all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Evgeny Zajcev <lg.zevlg@gmail.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: Mon, 07 Nov 2022 20:24:05 +0800	[thread overview]
Message-ID: <877d077y1m.fsf@yahoo.com> (raw)
In-Reply-To: <CAO=W_ZoW8iyh-O+a-gQNtp0AiTOxZX115MCyCa2kE+sOMBa8Lg@mail.gmail.com> (Evgeny Zajcev's message of "Mon, 7 Nov 2022 13:26:00 +0300")

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";
 

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





  parent reply	other threads:[~2022-11-07 12:24 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 [this message]
2022-11-12  9:48                   ` Evgeny Zajcev
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=877d077y1m.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59075@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=lg.zevlg@gmail.com \
    --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.