From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "James K. Lowden" Newsgroups: gmane.emacs.help Subject: Re: HTML img tags Date: Tue, 13 Dec 2016 23:44:32 -0500 Organization: http://www.NewsDemon.com Message-ID: <20161213234432.000a8c5604beab72f9907317@speakeasy.net> References: <8xxoa0johe9.fsf@village.keycorner.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481690745 24860 195.159.176.226 (14 Dec 2016 04:45:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 04:45:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 14 05:45:36 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cH1Rf-0004nz-9x for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 05:45:35 +0100 Original-Received: from localhost ([::1]:45499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH1Ri-0001m5-A1 for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Dec 2016 23:45:38 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad.highwinds-media.com!fx44.iad.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd) Original-Lines: 28 Original-X-Complaints-To: abuse@newsdemon.com Original-NNTP-Posting-Date: Wed, 14 Dec 2016 04:44:33 UTC X-Received-Bytes: 1755 X-Received-Body-CRC: 364776995 Original-Xref: usenet.stanford.edu gnu.emacs.help:219026 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111948 Archived-At: On Sat, 10 Dec 2016 10:53:02 -0600 Hikaru Ichijyo wrote: > I realize there's probably no way for Emacs to do that without > calling external programs as a subprocess Not no way, but no reason to. :-) > I'd rather do everything in Emacs. Just to tease you a little bit, you don't really mean that. You let emacs rely on the OS to provide a machine abstraction, for instance. I doubt you want to write directly to the hardware in elisp. Once you accept there's no "everything", you're on a slippery slope. The question becomes merely, "how can emacs most readily obtain the information I want?" And to that, I have an answer for you! The ImageMagick package includes a utility "identify" that surely produces the information you need. If I wanted something to "guess the width= and height= attributes" of a file, I'd probably write a little awk script to spit out the HTML I wanted, and invoke that from emacs. If I wanted to do everything in emacs, I guess I'd invoke "identify" directly, and winnow its output in elisp. HTH. --jkl