From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58041: [PATCH] docview: Use svg images when using mupdf for conversion Date: Mon, 09 Jan 2023 09:51:42 -0500 Message-ID: References: <87k05t848c.fsf@gmail.com> <87eds5zhf7.fsf@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30558"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 58041@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 09 15:53:50 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 1pEtX3-0007oO-Ur for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Jan 2023 15:53:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEtVO-00054x-MP; Mon, 09 Jan 2023 09:52:06 -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 1pEtVL-00051s-1m for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2023 09:52: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 1pEtVK-0003VX-Ba for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2023 09:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEtVK-00084n-1h for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2023 09:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Jan 2023 14:52: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.167327591531028 (code B ref 58041); Mon, 09 Jan 2023 14:52:02 +0000 Original-Received: (at 58041) by debbugs.gnu.org; 9 Jan 2023 14:51:55 +0000 Original-Received: from localhost ([127.0.0.1]:36102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEtVC-00084O-Kj for submit@debbugs.gnu.org; Mon, 09 Jan 2023 09:51:54 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEtVA-00084A-0w for 58041@debbugs.gnu.org; Mon, 09 Jan 2023 09:51:53 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2F22B806D4; Mon, 9 Jan 2023 09:51:46 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3EFB68058E; Mon, 9 Jan 2023 09:51:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1673275904; bh=q75QA2T4gOskrjyfcqHLE72pMWKNwbKALdUf786tSQA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jTcdfObL8LHez7qYJ7J6pUqYAuv1tSx/UK2LooPybtdjOfxWIlbyVPqodOJuUGuQx FcSSwyDdzi0nl46CI2IarZVLbQoGabpPVhA3nOQDmB1X5l1v0gRbyqmSHKu89cNuSm qY/HF2V+jDOhObaE7oEFJ8uFezGDbtYdus+RVylTRVmRGj8G2ICZ/7gSDvKsKhc8nW YOpL61lnPZP9DOocdqUTivKRuRP1IzLk7Bq7eZ++rNPPhruN8h2K1GToUGBUb2z38w 9SBIFyumKbstUXvLPDCrpn3GwN/DQ0NDGTIgM7Rg0lSAuyqE8ULRG96dDhOOJczqYZ Z8bscxi/bMe9A== Original-Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1D9C3120DE3; Mon, 9 Jan 2023 09:51:44 -0500 (EST) In-Reply-To: <87eds5zhf7.fsf@gmail.com> (Visuwesh's message of "Sun, 08 Jan 2023 11:39:16 +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:253023 Archived-At: >>> Attached patch makes mupdf produce svg images rather than png when svg >>> support is available. This makes a noticeable improvement in image >>> quality when zooming in. >> IIUC this means that `+` and `-` now don't need to re-process the PDF, right? >> I think this is particularly valuable for things like ODT where `+/-` >> was pretty slow (because it re-created the PDF each time before having >> a chance to focus on the current page). > It depends on the value of `doc-view-scale-internally'. The default > value (t) implies that we change the :width image property which leads > to blurry images when zooming. In my case, even without zooming in, the > image quality was noticeably worse. So `doc-view-scale-internally` should default to nil when we use SVGs, right? > If `doc-view-scale-internally' is nil though, what you say happens. 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? Another thing that's odd now is that we use `doc-view-pdf->png-converter-function` to convert to SVG, despite its name. >> Other reasons it's worth mentioning in NEWS is because there's a new >> Custom to control it, and because it causes a regression for those LaTeX >> files which end up embedding bitmap fonts. I just bumped into one and >> couldn't understand why every page took almost a minute to load; >> Removing `\usepackage[T1]{fontenc}` fixed the problem. > For the most part, I assumed MuPDF's svg and png conversion was > one-to-one. My testing with small docx and Excel files went smooth so I > didn't think this feature warranted a NEWS entry. I don't know exactly what happens with those LaTeX-generated PDF files, indeed. I haven't bumped into the problem with any other PDF files yet (including scans). But those PDF files with embedded bitmap fonts used the be the norm in the LaTeX world in some distant past, so I'm sure some of our users will bump into them. Stefan