From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kBxUNuHPRmDFFQAA0tVLHw (envelope-from ) for ; Tue, 09 Mar 2021 01:31:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id APYiMuHPRmDzZwAAbx9fmQ (envelope-from ) for ; Tue, 09 Mar 2021 01:31:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4775FC7AB for ; Tue, 9 Mar 2021 02:31:13 +0100 (CET) Received: from localhost ([::1]:47424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJRDK-0006rR-SF for larch@yhetil.org; Mon, 08 Mar 2021 20:31:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJRCH-0006rH-1x for emacs-orgmode@gnu.org; Mon, 08 Mar 2021 20:30:07 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:38868) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJRCE-0000NT-Vs for emacs-orgmode@gnu.org; Mon, 08 Mar 2021 20:30:04 -0500 Received: by mail-pf1-x433.google.com with SMTP id 16so6872684pfn.5 for ; Mon, 08 Mar 2021 17:30:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=seSMxhcNv8v/XpqkMRS0tS979pCTd+gmoNKRspwikKw=; b=eLPDWAZRuAfZqjGGQfRYtGgAwrJ25kNr5WK+9Xn24DM/Y7JKpxWD6kAsInHSvgwo67 uaUVLRJ0l1Q/lF3/fS7intT0GkEAkfe1TZP26qcw+/EzZ/A7vOEVt5YbicVDcWFywkNa amQ4AL0FCXQrR7proC1dmi84DcP4DtEr3khkoT+cVH9wJkp7Pni822s7RHJi7EF4mK2E HCqqTOrWR7nE8oINobKAlJX6N2/cqxhtu7ahN5yfkQCeojvfPmATWI60mSS/kx7yfa3+ p2hwiE1crc9+7grwQAHy5bMqseIQS8zkvkawDXEN63LLHQV2/xTODjOViV+rTwD9U1jd KtXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=seSMxhcNv8v/XpqkMRS0tS979pCTd+gmoNKRspwikKw=; b=LJ/g1IXGlgl+5vjBKTHgnC9PXrfv7RYJ6TOAG/wyViK5FQBsGy41vEzwsHk33xDRmH jFE+x2MPVt+SuGT8kFdpIviO14x10K76jy8uGssyXT+m27tOV1a7sY32JrS+VhV1wqPb mCXELMw4lfjVvoJ78Q+jE5LfpjUsQOJu65fbjdd8ONyF4AS5vIbOQ4+NIZTM9q+EiFs1 9zopsKybrU7CYEsgavJg6qoNRPnUmDH9oVw/DGstcUbESbzN0MZS/izAm8DlRTgvYUL1 04gVbKzlCqSIryhn+ldFwIABVs0KXaNJ0jetluKE4s+C3PmpdJxDoLiU/Jno3Tji7RRN wVQw== X-Gm-Message-State: AOAM530IjYXYst9z95wAtqTv+3ZK73MPJnWo1z9XCGHoKvpuP8kcN/XG QLdK8AMY1LWiIWPSuNEQ+Uf95X7lmmk6Rw== X-Google-Smtp-Source: ABdhPJwIDDuF1axDHfvB2eQflwQXhO5euhuVUcKbc3WHTbqDbbsBlJI0ROl6pheDV0SQa52op6D9vQ== X-Received: by 2002:a62:5e02:0:b029:1ed:8bee:6132 with SMTP id s2-20020a625e020000b02901ed8bee6132mr24304993pfb.48.1615253400188; Mon, 08 Mar 2021 17:30:00 -0800 (PST) Received: from eve (c-24-130-67-196.hsd1.ca.comcast.net. [24.130.67.196]) by smtp.gmail.com with ESMTPSA id 2sm11180026pfi.116.2021.03.08.17.29.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 17:29:59 -0800 (PST) User-agent: mu4e 1.0; emacs 26.1 From: Jay Kamat To: Org Mode Subject: [PATCH] ox-html: Add webp as an inline image format Date: Mon, 08 Mar 2021 17:30:33 -0800 Message-ID: <87wnuhxgee.fsf@eve> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=jaygkamat@gmail.com; helo=mail-pf1-x433.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615253473; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=seSMxhcNv8v/XpqkMRS0tS979pCTd+gmoNKRspwikKw=; b=J+QrSV/HzXNLe+TjyK+nqJaQPSfEu/XLY2t4gb6Ka1rIZB5UxThjNuT8dkvgxNY6UVf9r4 9YzumxAvMl3B9GrDeIS3IpwAFjBKhTT9oZGAG9OUQlYQ+R2SXw4RaBoJ/Dn+La2E8TuTr7 yZ9Su6DBJwBFbZQQLOo1gSLWMQAOiEKZZEHnO9qhxxCxdSMQgS0Ukd3DFyRLGXpPQ5oix7 LXSGZ1lBYcpbHw4+JCpq/81JK9Ekmh3iDmIuQdNb/bzA3yvnw+4nLTv7WK3IrlU6byHakn +slvmYZfNnG0B/7KOvh5A3k85k7erR6+56zAIaKrPXN0XA5psf4iHeXogV1AWQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615253473; a=rsa-sha256; cv=none; b=prs+G0W1JqkMSA/PDsAs3JN1uYjy0nPjbEq7KJW1FON3a0I4iOVJwxoyea28fG4Xo94TXY 9h5yI9l82TNGXgUNMCwFNzufl0ZI/w8ryNuBHZB3I0ljgO90H4vXnh5P9tK+yk+FSQ1orT HC7lxPTuTCpiFfNcBWBana5R1NB0kXB100bGB4SuiGaidp1kmaTyUr/WXzamW337dnCvDf 7CU35ytobILaaa3Dh4nxiv4KnO+/CzbXBt3O5+3Vxpjc5TyrcfycYnZ5vdbl0iPxCW5IcE +S9XcNHP2B7EmQ7OKGusGtb/0GES0TWP0W0pPhJGfrdW5OEJJm9tJrzdym089A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=eLPDWAZR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.58 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=eLPDWAZR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4775FC7AB X-Spam-Score: -2.58 X-Migadu-Scanner: scn0.migadu.com X-TUID: SOWy02h2k8Ri --=-=-= Content-Type: text/plain; format=flowed Hi, By default, ox-html inlines most image links (such as png and jpg). However, this is currently not the case for webp. Webp is a image format introduced in 2010 by Google, which now has widespread adoption in mainstream browsers. I personally would like to use it because it has much better compression levels than the older alternatives. For more information on support levels, this site has a synopsis: https://caniuse.com/webp Since it has widespread adoption and support, I would like to propose adding it to the default filetypes ox-html inlines as images. A patch is provided below to do this. Let me know if you have any thoughts or suggestions. Thanks for all your hard work, -Jay --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-html-Add-webp-as-an-inline-image-format.patch >From e7385370a9a023a68f123374793bc8d706d5580c Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 8 Mar 2021 16:55:37 -0800 Subject: [PATCH] ox-html: Add webp as an inline image format * lisp/ox-html.el (org-html-inline-image-rules): Add webp as an inline image format Webp is an image format introduced in 2010, which now has widespread support in browsers. ox-html can inline webp images identically to how it does already for other image formats. Signed-off-by: Jay Kamat --- lisp/ox-html.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 11757bb35..3fa5ef864 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -848,9 +848,9 @@ link to the image." :type 'boolean) (defcustom org-html-inline-image-rules - `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg"))) - ("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg"))) - ("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg")))) + `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp"))) + ("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp"))) + ("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp")))) "Rules characterizing image files that can be inlined into HTML. A rule consists in an association whose key is the type of link to consider, and value is a regexp that will be matched against -- 2.20.1 --=-=-=--