all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Displaying SVG content in EWW
@ 2019-10-18  7:37 Pankaj Jangid
  2019-10-18  8:09 ` Eli Zaretskii
       [not found] ` <mailman.1075.1571384277.9715.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Pankaj Jangid @ 2019-10-18  7:37 UTC (permalink / raw)
  To: Emacs mailing list

Hi,

Whenever there is <svg> content on a webpage, eww emits the error shown
below. There are two ways I should be getting rid of the error message:

1. Ignore this somewhere in config (I don't know how)
2. Fix it to support SVG rendering (I don't know this either)

Please help me solve this. 2nd approach is preferred if there is a
solution. I am using Emacs 26.3 on MacOS.

Error Message:

 entered--Lisp error: (error "Invalid image type ‘svg’")
  signal(error ("Invalid image type ‘svg’"))
  error("Invalid image type `%s'" svg)
  image-type("<svg width=\"118\" height=\"78\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke=\"#848A91\"><path d=\"M34.05 55.73L18.5 43.5h-12L1.25 5.47 67.69.69 52.4 43.5H30.99zM10.5 16.5h45M10.5 25.5h39M10.5 34.5h24M69.16 77.39l-4.7-2.89h-6.12l-2.71-12.23 24.29-2.48-3.23 14.71h-8.83zM61.5 65.5h13M61.5 68.5h10M61.5 71.5h7M80.16 36.07l5.34-4.57h7V19.03l-24.8-3.4 2.8 15.87 10.78.1zM89.5 21.5h-17M89.5 25.5h-15M89.5 28.5h-9M96.84 70.5l10.77-9h6.12l2.89-19.85-39.59-4.57 8.84 25.42h12.57zM111.5 46.5h-27M111.5 52.5h-23M111.5 57.5h-15M43.39 43.49L58.34 61.5M61.74 18.69l8.84 12.57M92.5 25l15.11 15.43M80 59.5l3.15-3.78M52.57 43.49l27.52 3.06\"/></g></svg>" svg t)
  create-image("<svg content...>" svg t :ascent 100)
  shr-put-image(("<svg content...>" image/svg+xml) #(" " 0 1 (keymap (keymap (13 . shr-browse-url) (79 . shr-save-contents) (118 . shr-browse-url) (117 . shr-maybe-probe-and-copy-url) (119 . shr-maybe-probe-and-copy-url) (73 . shr-insert-image) (mouse-2 . shr-browse-url) (follow-link . mouse-face) (27 keymap (9 . shr-previous-link)) (9 . shr-next-link) (122 . shr-zoom-image) (105 . shr-browse-image) (97 . shr-show-alt-text) keymap (111 . image-save) (114 . image-rotate) (43 . image-increase-size) (45 . image-decrease-size)) shr-alt "*" image-url "https://cdn.sstatic.net/Img/home/public-qa.svg?v=d82acaa7df9f" image-displayer (lambda (url start end) (when url (if (string-match "\\`cid:" url) nil (url-retrieve url (quote shr-image-fetched) (list (current-buffer) start end) t t)))) help-echo #("*" 0 1 (shr-indentation nil face variable-pitch)))) (:width nil :height nil))
  ......
  ......
  url-http-activate-callback()
  url-http-content-length-after-change-function(372 1081 709)
  url-http-generic-filter(#<process cdn.sstatic.net> "<svg width=\"118\" height=\"78\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke=\"#848A91\"><path d=\"M34.05 55.73L18.5 43.5h-12L1.25 5.47 67.69.69 52.4 43.5H30.99zM10.5 16.5h45M10.5 25.5h39M10.5 34.5h24M69.16 77.39l-4.7-2.89h-6.12l-2.71-12.23 24.29-2.48-3.23 14.71h-8.83zM61.5 65.5h13M61.5 68.5h10M61.5 71.5h7M80.16 36.07l5.34-4.57h7V19.03l-24.8-3.4 2.8 15.87 10.78.1zM89.5 21.5h-17M89.5 25.5h-15M89.5 28.5h-9M96.84 70.5l10.77-9h6.12l2.89-19.85-39.59-4.57 8.84 25.42h12.57zM111.5 46.5h-27M111.5 52.5h-23M111.5 57.5h-15M43.39 43.49L58.34 61.5M61.74 18.69l8.84 12.57M92.5 25l15.11 15.43M80 59.5l3.15-3.78M52.57 43.49l27.52 3.06\"/></g></svg>")

...End of email
--
Regards,
Pankaj Jangid



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Displaying SVG content in EWW
  2019-10-18  7:37 Displaying SVG content in EWW Pankaj Jangid
@ 2019-10-18  8:09 ` Eli Zaretskii
       [not found]   ` <CAPeGcy-iwLkwPXFqZVtJxVnPjeix=CWKm24BfJ6HFCEOJe3fRA@mail.gmail.com>
       [not found] ` <mailman.1075.1571384277.9715.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2019-10-18  8:09 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Pankaj Jangid <pankaj.jangid@gmail.com>
> Date: Fri, 18 Oct 2019 13:07:43 +0530
> 
> Whenever there is <svg> content on a webpage, eww emits the error shown
> below. There are two ways I should be getting rid of the error message:
> 
> 1. Ignore this somewhere in config (I don't know how)
> 2. Fix it to support SVG rendering (I don't know this either)
> 
> Please help me solve this. 2nd approach is preferred if there is a
> solution. I am using Emacs 26.3 on MacOS.

What does the following display?

  M-: (image-type-available-p 'svg) RET

If it says "nil", you don't have SVG image support built into your
Emacs, or don't have one of the requisite shared libraries available.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Displaying SVG content in EWW
       [not found]   ` <CAPeGcy-iwLkwPXFqZVtJxVnPjeix=CWKm24BfJ6HFCEOJe3fRA@mail.gmail.com>
@ 2019-10-18 12:31     ` Eli Zaretskii
  2019-10-18 13:32       ` Pankaj Jangid
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2019-10-18 12:31 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Richard Melville <6tricky9@gmail.com>
> Date: Fri, 18 Oct 2019 13:01:13 +0100
> 
>  What does the following display?
> 
>    M-: (image-type-available-p 'svg) RET
> 
>  If it says "nil", you don't have SVG image support built into your
>  Emacs, or don't have one of the requisite shared libraries available.
> 
> Mine returns "No match" rather than "nil".

How did you type that?  M-: means press and hold the META key (perhaps
the Alt key on your keyboard) and then press ':'.  This should display
"Eval: " in the minibuffer, and then you type

  (image-type-available-p 'svg)

and press Enter.

If that's what you did, perhaps there's something here that is
specific to macOS, which I don't use and know almost nothing about.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Displaying SVG content in EWW
  2019-10-18 12:31     ` Eli Zaretskii
@ 2019-10-18 13:32       ` Pankaj Jangid
  0 siblings, 0 replies; 6+ messages in thread
From: Pankaj Jangid @ 2019-10-18 13:32 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Richard Melville <6tricky9@gmail.com>
>> Date: Fri, 18 Oct 2019 13:01:13 +0100
>> 
>>  What does the following display?
>> 
>>    M-: (image-type-available-p 'svg) RET
>> 
>>  If it says "nil", you don't have SVG image support built into your
>>  Emacs, or don't have one of the requisite shared libraries available.
>> 
>> Mine returns "No match" rather than "nil".
>

Thanks for all help. I rebuilt emacs with --with-librsvg and it worked.

> How did you type that?  M-: means press and hold the META key (perhaps
> the Alt key on your keyboard) and then press ':'.  This should display
> "Eval: " in the minibuffer, and then you type
>
>   (image-type-available-p 'svg)
>
> and press Enter.
>

M-: didn't display Eval: on my setup. But I typed the above expression
in my *scratch* buffer and pressed C-x C-e (eval-last-sexp). I got the
point suggested by Richard.


-- 
Pankaj Jangid



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Displaying SVG content in EWW
       [not found] ` <mailman.1075.1571384277.9715.help-gnu-emacs@gnu.org>
@ 2019-10-19  8:24   ` Lars Magne Ingebrigtsen
  2019-10-19  8:56     ` Pankaj Jangid
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2019-10-19  8:24 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: Emacs mailing list

Pankaj Jangid <pankaj.jangid@gmail.com> writes:

> Whenever there is <svg> content on a webpage, eww emits the error shown
> below. There are two ways I should be getting rid of the error message:

[...]

>  entered--Lisp error: (error "Invalid image type ‘svg’")

[...]

>   create-image("<svg content...>" svg t :ascent 100)
>   shr-put-image(("<svg content...>"

This means that your Emacs is compiled without svg support.  However,
eww shouldn't bug out here -- in Emacs 27, I've now fixed this so that
it'll just ignore the svg images instead of bugging out.

Thanks for reporting the error.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Displaying SVG content in EWW
  2019-10-19  8:24   ` Lars Magne Ingebrigtsen
@ 2019-10-19  8:56     ` Pankaj Jangid
  0 siblings, 0 replies; 6+ messages in thread
From: Pankaj Jangid @ 2019-10-19  8:56 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Emacs mailing list

Lars Magne Ingebrigtsen <lmi@gnus.org> writes:

> Pankaj Jangid <pankaj.jangid@gmail.com> writes:
>
>> Whenever there is <svg> content on a webpage, eww emits the error shown
>> below. There are two ways I should be getting rid of the error message:
>
> [...]
>
>>  entered--Lisp error: (error "Invalid image type ‘svg’")
>
> [...]
>
>>   create-image("<svg content...>" svg t :ascent 100)
>>   shr-put-image(("<svg content...>"
>
> This means that your Emacs is compiled without svg support.  However,
> eww shouldn't bug out here -- in Emacs 27, I've now fixed this so that
> it'll just ignore the svg images instead of bugging out.
>
> Thanks for reporting the error.

eww is probably bugging out because I have (setq debug-on-error
t). Instead of simply ignoring if we can render some hint then the
user will know the issue.

Thanks for taking this up.

--
Regards,
Pankaj Jangid



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-19  8:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-18  7:37 Displaying SVG content in EWW Pankaj Jangid
2019-10-18  8:09 ` Eli Zaretskii
     [not found]   ` <CAPeGcy-iwLkwPXFqZVtJxVnPjeix=CWKm24BfJ6HFCEOJe3fRA@mail.gmail.com>
2019-10-18 12:31     ` Eli Zaretskii
2019-10-18 13:32       ` Pankaj Jangid
     [not found] ` <mailman.1075.1571384277.9715.help-gnu-emacs@gnu.org>
2019-10-19  8:24   ` Lars Magne Ingebrigtsen
2019-10-19  8:56     ` Pankaj Jangid

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.