From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#56552: [PATCH] Make gnus display webp images inline Date: Thu, 14 Jul 2022 18:03:13 +0530 Message-ID: <87mtdbswl2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10843"; mail-complaints-to="usenet@ciao.gmane.io" To: 56552@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 14 14:48:12 2022 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 1oByGK-0002aq-44 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jul 2022 14:48:12 +0200 Original-Received: from localhost ([::1]:56538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oByGJ-0002nl-9b for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jul 2022 08:48:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oByGA-0002nc-BV for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 08:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oByGA-0007n1-2p for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 08:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oByG9-0000TK-UM for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 08:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jul 2022 12:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56552 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16578028231611 (code B ref -1); Thu, 14 Jul 2022 12:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jul 2022 12:47:03 +0000 Original-Received: from localhost ([127.0.0.1]:36929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oByFD-0000Pq-4W for submit@debbugs.gnu.org; Thu, 14 Jul 2022 08:47:03 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oByFA-0000Oz-OP for submit@debbugs.gnu.org; Thu, 14 Jul 2022 08:47:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBy23-000435-Tn for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 08:33:28 -0400 Original-Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:41602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBy22-0005S6-49 for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 08:33:27 -0400 Original-Received: by mail-pj1-x1041.google.com with SMTP id o31-20020a17090a0a2200b001ef7bd037bbso3001518pjo.0 for ; Thu, 14 Jul 2022 05:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=cGR5xa0hQRdMxo+5Dh6CeQUYSDUJk5ZbwmWybwJL0Vk=; b=ANMAAbTBK3Go7gWktx15NMFaKX7NHJpDqaloRE5AdsOlqU34QyCSRlq21+mBd8ftgL bAmRP8Wb8zCGYOuJVT8UjKUzK/+dOiVoFuyZCU9LoejcVBR3J7NeMSWqOFrCF51JxxZf u3UI36t24ZO+J1KBk7Cls9W01MhMifpmkhvwvf0xEvRIt3VUqS4rXOkF39VtVM+FaHMM VS4KYjnKiUNzPt6j4ds3XmfS8Sf1nYJS4ZPj5YmU72QVEDrPHTE425s1FyX0f934ErxB VYKFow/XK9xhunJXg7yisDB5DJW/fi5FmRYZjoIPrHHFJS0r8tb0iW/d3IRTyvDUCIuX GOsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=cGR5xa0hQRdMxo+5Dh6CeQUYSDUJk5ZbwmWybwJL0Vk=; b=FSjQn2lin8EjauYDM0uxLdWtusMF8hwn/0+zTCLydXC/7w7vxkORaCf651jKg6hJbl 6FlhReTFlBUJ3Y//Kbv1Q8lr0iCUoW4et8HLYFjStPGXzNrsTUoUhBhL7YuY9YCa1b98 7nfyYQ8hi+gg2RNpO60Zz9ggfNudfL2q2qoHUiYpRVUu1R7mH7llgsqsCKNoiwDid8+S 12gC0WdLCUpTO1uTTwM+FKd9kPkh2UpM1jRzlUbMk+HgeWqzjukOikeHvbfOh7dKizIJ xjo2OO/VxcrOFoFwCnrvaV9vDvB/E3F5T1zkr29HpqkLzxzMc2RQAf4nGZ3mn0kkmj5L RZPw== X-Gm-Message-State: AJIora/XBkplhRz8IDBOLnbd7fffVMqOzBe9mGJDwBbJQLiVyDNQoaaf s75zwvZl3FQthcvTFu9zQm5bPomIGp0= X-Google-Smtp-Source: AGRyM1vLlYsxIRJmrYYxAzrJqsHW9fDd68Bb4uDhhERY/T/TXMySs6ivGDAgxn935V4gzda2VfoKgQ== X-Received: by 2002:a17:902:8309:b0:167:9a4c:cd58 with SMTP id bd9-20020a170902830900b001679a4ccd58mr8295315plb.166.1657802004480; Thu, 14 Jul 2022 05:33:24 -0700 (PDT) Original-Received: from localhost ([49.205.81.141]) by smtp.gmail.com with ESMTPSA id l62-20020a632541000000b004088f213f68sm1251957pgl.56.2022.07.14.05.33.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 05:33:23 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1041.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:236987 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch Severity: wishlist Now that Emacs has native support for display webp images, we should add a handler to display it inline. I also added image/webp to mailcap-mime-extensions since in my Debian installation, I had no entry for it in /etc/mime.types.=20=20 [ Since *.webp wasn't in that variable, nneething didn't do the Right Thing=E2=84=A2 to display webp file (it inserted the file as plain text).= ] --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Make-gnus-display-webp-images-inline.patch >From d4ed7bae076319cae3d9b0dd82ded37539f4039c Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Thu, 14 Jul 2022 17:45:31 +0530 Subject: [PATCH] Make gnus display webp images inline * lisp/gnus/mm-decode.el (mm-inline-media-tests): Add webp handler. * lisp/net/mailcap.el (mailcap-mime-extensions): Add webp mimetype. --- lisp/gnus/mm-decode.el | 6 +++++- lisp/net/mailcap.el | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 7256e5a2f7..79217d3400 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -193,7 +193,11 @@ mm-inline-media-tests `(("image/p?jpeg" mm-inline-image ,(lambda (handle) - (mm-valid-and-fit-image-p 'jpeg handle))) + (mm-valid-and-fit-image-p 'jpeg handle))) + ("image/webp" + mm-inline-image + ,(lambda (handle) + (mm-valid-and-fit-image-p 'webp handle))) ("image/png" mm-inline-image ,(lambda (handle) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index 8ba7f1bec3..ee72eba35d 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -974,6 +974,7 @@ mailcap-mime-extensions (".ai" . "application/postscript") (".jpe" . "image/jpeg") (".jpeg" . "image/jpeg") + (".webp" . "image/webp") (".org" . "text/x-org")) "An alist of file extensions and corresponding MIME content-types. This exists for you to customize the information in Lisp. It is -- 2.35.1 --=-=-= Content-Type: text/plain In GNU Emacs 29.0.50 (build 11, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2022-07-14 built on astatine Repository revision: d37ba6f259b972aa44c66ecb76210e03a3084183 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --with-sound=alsa --with-x-toolkit=lucid --with-json --without-xaw3d --without-gconf --without-libsystemd --without-cairo' --=-=-=--