From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58041: [PATCH] docview: Use svg images when using mupdf for conversion Date: Thu, 12 Jan 2023 10:11:38 +0200 Message-ID: <83pmbkkw91.fsf@gnu.org> References: <87k05t848c.fsf@gmail.com> <87eds5zhf7.fsf@gmail.com> <87v8lfy8g5.fsf@gmail.com> <87fscgxng0.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40734"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 58041@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 12 09:12:28 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 1pFshI-000APp-LQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Jan 2023 09:12:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFsgu-0001Yi-PZ; Thu, 12 Jan 2023 03:12:04 -0500 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 1pFsgt-0001XV-5W for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 03:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFsgs-0000L9-Q2 for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 03:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFsgs-0004kd-G2 for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 03:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Jan 2023 08:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58041 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58041-submit@debbugs.gnu.org id=B58041.167351107418201 (code B ref 58041); Thu, 12 Jan 2023 08:12:02 +0000 Original-Received: (at 58041) by debbugs.gnu.org; 12 Jan 2023 08:11:14 +0000 Original-Received: from localhost ([127.0.0.1]:44505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFsg5-0004jV-Mr for submit@debbugs.gnu.org; Thu, 12 Jan 2023 03:11:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFsg3-0004jH-EQ for 58041@debbugs.gnu.org; Thu, 12 Jan 2023 03:11:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFsfx-00009l-AJ; Thu, 12 Jan 2023 03:11:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6t8dHpzD1IXjYOIsi+NMTEtM59LzoauLEka0BD/s87A=; b=ZR1yNNX453XP gn4Yw9yxE81E+gra3n3g1zffjLbmTEqlKXhM4WAH7zYdPdZpoDJhf1Bt1dNSAWqW1aGp0FOsW4sx4 MKhi/K7n0rgCIGDc1XIeidlBppLd63htZaRZCEJS5wLScRKVEC+sr7ofGL4jGdcoYTjL/M8viiR6K U6N+Ux/Q7rZUpCdoNuJc4YlhVCAq93aWyo53cFE8dP1J2PfhwKMOqRIqjhwpyMTEUjZVP3z8x7AfR 2YSnsDlhEjwSyIfAWQum+uQHyD/kPmL5zEhSZQ7Fqp7KhXlZGoWR3yTStXid8LGSOe0D7Q9yymn0B 2QcTzm4/DMsK1SxkH+3yYg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFsfw-0005C2-JJ; Thu, 12 Jan 2023 03:11:04 -0500 In-Reply-To: <87fscgxng0.fsf@gmail.com> (message from Visuwesh on Thu, 12 Jan 2023 12:13:27 +0530) 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:253181 Archived-At: > Cc: 58041@debbugs.gnu.org > From: Visuwesh > Date: Thu, 12 Jan 2023 12:13:27 +0530 > > >>> IIUC you're saying here that when `doc-view-scale-internally` is nil we > >>> re-create the SVGs every time the users try to zoom in/out? While not > >>> strictly a bug, it's a significant inefficiency we should address, no? > >> I suppose so. But I'm not really sure if users out in the wild adjust > >> the variable. > > > > I set it to nil because of the blurriness. > >> If they do, then it might be worth looking into ignoring > >> that variable if we're generating SVG images. > > > > Ah, that'd be a good option, indeed. > > Right, then I guess adjustment of that sort is in order. How about the > following patch? It should be safe enough to go to emacs-29. Since this is not fixing a bug, I'd prefer it to go to master. > +** doc-view now generates SVG images when viewing PDF files if possible. > +If Emacs is built with SVG support, doc-view defaults to generating > +SVG files when using MuPDF as the converter for PDF files which leads > +to genearlly sharper images (especially when zooming) and > +customization of background and foreground color of the page via the > +new user options 'doc-view-svg-background' and > +'doc-view-svg-foreground'. To get the old behaviour, set > +'doc-view-mupdf-use-svg' to nil. > +Note that MuPDF SVG generation is known to sometimes generate files > +that are buggy or can take a long time to render. The last sentence makes me wonder why we made a less-than-perfect option the default. It's against our usual conservative approach.