From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#64908: 29.1; svg parse failure Date: Sat, 5 Aug 2023 17:02:20 +0100 Message-ID: References: <835y5vw1ay.fsf@gnu.org> <83350yvd5f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40525"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 64908@debbugs.gnu.org To: David Ponce Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 05 18:03:31 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qSJkZ-000AMB-OJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Aug 2023 18:03:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSJkM-0006dP-CS; Sat, 05 Aug 2023 12:03:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSJk6-0006Wl-Sd for bug-gnu-emacs@gnu.org; Sat, 05 Aug 2023 12:03:06 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSJk6-0007r3-Kb for bug-gnu-emacs@gnu.org; Sat, 05 Aug 2023 12:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qSJk6-00059A-38 for bug-gnu-emacs@gnu.org; Sat, 05 Aug 2023 12:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Aug 2023 16:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64908 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: unreproducible Original-Received: via spool by 64908-submit@debbugs.gnu.org id=B64908.169125135919753 (code B ref 64908); Sat, 05 Aug 2023 16:03:02 +0000 Original-Received: (at 64908) by debbugs.gnu.org; 5 Aug 2023 16:02:39 +0000 Original-Received: from localhost ([127.0.0.1]:57986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSJjh-00058T-K1 for submit@debbugs.gnu.org; Sat, 05 Aug 2023 12:02:39 -0400 Original-Received: from dane.soverin.net ([185.233.34.148]:49525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSJjc-00058D-FP for 64908@debbugs.gnu.org; Sat, 05 Aug 2023 12:02:36 -0400 Original-Received: from smtp.soverin.net (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4RJ6mL70YWz2xFn; Sat, 5 Aug 2023 16:02:26 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by soverin.net (Postfix) with ESMTPSA id 4RJ6mL0fCSzBX; Sat, 5 Aug 2023 16:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1691251346; bh=kW6J1f5QW3XYS0truu6rZA7I11gl+VqRYKmnCcEK8rk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DVSb5tadFhGRMxfBPpI/jAkrljV3KvlRomhTQ9trjLb1V82K3pSsR9tRSu6GFO8es eb0Zzd2jUInYz1Rs4ZBO2JsqJVHJurCubfX09JFximmIMCPVbh7p8KsX6QInw4p0Ps Fbitc265KP24jVmYIbiMH9RFaPZsgbrLV/EoPYaGQ6dib0JPb3lGENDKYVgtXnnWcz 0g9ziRTIPB7B/Y2jxMc1VxZAR5D4EjSMErLmzK0r2ZGWmhy8ljIA5bCmtdT/QdJLMh 4fxhvG+umTyd/Vo+OaDAvm+kbyIpUWPUXMPqJ/Yu1yFa+oW3mctsCUowH709PGYyX3 Flr4OMi9A6Z1Q== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.96) (envelope-from ) id 1qSJjQ-000REc-3A; Sat, 05 Aug 2023 17:02:20 +0100 X-Soverin-Authenticated: true Mail-Followup-To: Alan Third , David Ponce , Eli Zaretskii , 64908@debbugs.gnu.org Content-Disposition: inline In-Reply-To: X-CMAE-Score: 0 X-CMAE-Analysis: v=2.4 cv=LJ6gAra9 c=1 sm=1 tr=0 ts=64ce7292 a=kj9zAlcOel0A:10 a=UttIx32zK-AA:10 a=SSmOFEACAAAA:8 a=BKAKXnQ7tnAZNZVM3xQA:9 a=CjuIK1q_8ugA:10 X-Cloudmark-Reporter: H1BfMDDIseXVAGznanf59hmP2F4= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266795 Archived-At: On Sat, Aug 05, 2023 at 05:53:52PM +0200, David Ponce wrote: > On 05/08/2023 17:14, Alan Third wrote: > > On Sat, Aug 05, 2023 at 02:32:07PM +0200, David Ponce wrote: > > > On 05/08/2023 11:58, Alan Third wrote: > > > I did test your V2 patch, and it seems to work well. > > > I tend to agree with your reasoning, even if I am not enough a > > > librsvg expert to fully understand all the details. > > > > Thanks! > > > > > One case however is not working, when the svg image just specify > > > percentage for width and height without a viewbox, like this: > > > > > > '(image :type svg :data > > > " > > > > > > > > > > > > > > style=\"fill:currentColor;fill-opacity:1;stroke:none\" > > > d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\" > > > class=\"ColorScheme-Text\" > > > /> > > > " > > > :scale 1) > > > > > > I can display a such image in firefox, gwenview, or inkscape, but not in Emacs. > > > I guess it works in applications that provide a default viewbox when not defined. > > > And it is failing in Emacs because no default viewbox is provided. > > > > Very strange, it works here. rsvg_handle_get_geometry_for_layer should > > handle this fine. I wonder if something subtle has changed with > > 2.56... I can't fine anything in the documentation to say this has > > changed... > > > > We can always provide an absolute fallback of 100x100 or something. I > > think that's what we used to do. But it would be good to know if > > something is actually broken here. Are you able to check the return > > value of rsvg_handle_get_geometry_for_layer and see if it's throwing > > up an error? > > Using this image spec: > > '(image :type svg :data > " > > > > style=\"fill:currentColor;fill-opacity:1;stroke:none\" > d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\" > class=\"ColorScheme-Text\" > /> > " > :scale 1 :width 22 :height 22) > > rsvg_handle_get_geometry_for_layer returns 1, and insert-image displays > a black square of 22x22 pixels. Is your Emacs background black? It sounds like rsvg_handle_get_geometry_for_layer is working, but something else is going wrong... If you're able to use a debugger (I think you already did earlier in this thread) can you check the values of zero_rect, viewbox and out_logical_rect after rsvg_handle_get_geometry_for_layer has run? -- Alan Third