From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pinmacs Newsgroups: gmane.emacs.devel Subject: Re: yank-media: allow users to limit image types that can be inserted Date: Thu, 31 Oct 2024 12:51:04 +0100 Message-ID: <72fa1515-e2fc-4f01-8a86-da06e4377a98@cas.cat> References: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> <86ed5ahb08.fsf@gnu.org> <87zfnywki8.fsf@gmail.com> <86setqfnmq.fsf@gnu.org> <87frpqflv4.fsf@gmail.com> <86ikumfjri.fsf@gnu.org> <877cb2fj0c.fsf@gmail.com> <86cykufhw7.fsf@gnu.org> <3a015d0f-549a-401f-be1c-651c9dbd5d9a@cas.cat> <8634lqfcaf.fsf@gnu.org> <87ikulwsd6.fsf@gmail.com> <86o74ddzxp.fsf@gnu.org> <87msiqvkph.fsf@localhost> <86ed42bs03.fsf@gnu.org> <874j4yot7x.fsf@localhost> <861q01c3h9.fsf@gnu.org> <87wmht3n17.fsf@gmail.com> <86v7xdamck.fsf@gnu.org> <87sesh37ya.fsf@gmail.com> <86iktd8o9h.fsf@gnu.org> <87iktb171d.fsf@gmail.com> <830de500-7c21-4dad-8290-9ab0f210af97@cas.cat> <86y1243cbx.fsf@gnu.org> <358410b5-29c3-4c75-a63c-68edd123fad8@cas.cat> <86froc34kz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10581"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 31 12:53:38 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t6Tk8-0002ZA-DX for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Oct 2024 12:53:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6TjC-000866-EX; Thu, 31 Oct 2024 07:52:38 -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 1t6Thr-0007df-DL for emacs-devel@gnu.org; Thu, 31 Oct 2024 07:51:16 -0400 Original-Received: from cas.cat ([45.150.187.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6Thk-0000xv-Hm; Thu, 31 Oct 2024 07:51:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cas.cat; s=2023; t=1730375465; bh=yKf712eCNLhN1LW73NTW+ntFizu4Rv3Px5qpb+2aHzw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZQBAmWoFnBC0UkeJhm6FoobKjFR+PoUEYLMkYMwiuKQwtEdeNYcRql82eHoUys43t R5XTe3H86Jeui8cjYz7zF29KoGi88RHZCRm3fE+v5ttLpr/V6DMkEM7nWloaYy5KR4 8qDqGHe6sF7ok8Le7/n9fejFLCDN0dxAMt05o7UX3Oy19G5W9ih7XXMw1brLq/ouXQ TM5rRyV81w3dRF+1MvOJdmI3ytxWU2w9kLelrXznG16OaphhccuKQQk+PGGCHO9lNx VLIRHt/P2V0hpFkbO9z3NjzboDerGzm6nInbQHXDCliBfkvUpVZ16oSh3BUWBuW6LW CodPKWfA8+j5Q== Content-Language: en-US In-Reply-To: <86froc34kz.fsf@gnu.org> Received-SPF: pass client-ip=45.150.187.15; envelope-from=pinmacs@cas.cat; helo=cas.cat 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, WIKI_IMG=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324966 Archived-At: On 2024-10-31 12:16, Eli Zaretskii wrote: >> Date: Thu, 31 Oct 2024 11:47:42 +0100 >> From: pinmacs >> >> Maybe I am missing too but when you choose a format, you choose how you >> store and retain that information. Depending on what you are going to do >> with that images, you might be interested in different formats. > That is inaccurate: the format in which the yanked data is store in > Emacs does NOT depend on your selection. Your selection only > determines how Emacs will fetch the data from the clipboard/selection, > and therefore also how it will interpret that data for the purpose of > inserting it into a buffer. Hi Eli, Let me provide more detail. For the way I use it through orgmode the selection determines how the file is stored. If I do 2 screen captures of nature [0], and I save one of them with png and jpeg, this is  what appears in my orgmode buffer: file:/path/to/emacs-orgmode-images/2024/2024-10-31_12-36-45_screenshot.png file:/path/to/emacs-orgmode-images/2024/2024-10-31_12-36-59_screenshot.jpeg Hence, new files where saved. And that has an impact in file size, so in [1] png takes 8 times more, because jpeg is able to compress better a natural image [2]. So me as user in two different use cases of yank-media: - So, me in a day where I am working in IT stuff related, I might want to just select preferred format as png if what I capture is more synthetic, such as text, log errors, visual annotations on user interfaces. - And me, in a day where I am planning a hiking, I might want to select jpeg as preferred format, if I am planning to go to nature, and I am looking on images of nature... because maybe I don't want to save full images, but take pieces of it Let me know if you want the exact results attached in the mailing list, or you are able to reproduce yourself. Cheers, pinmacs [0] https://en.wikipedia.org/wiki/Nature_photography#/media/File:Altja_j%C3%B5gi_Lahemaal.jpg [1]   [2024-10-31 Thu 12:37:08] $ du -sh /path/to/emacs-orgmode-images/2024/2024-10-31_12-36-45_screenshot.png   805K /path/to/emacs-orgmode-images/2024/2024-10-31_12-36-45_screenshot.png   [2024-10-31 Thu 12:37:09] $ du -sh /path/to/org-extra/emacs-orgmode-images/2024/2024-10-31_12-36-59_screenshot.jpeg   101K /path/to/emacs-orgmode-images/2024/2024-10-31_12-36-59_screenshot.jpeg [2] here is why https://www.techsmith.com/blog/jpg-vs-png/