From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: bvraghav@iitk.ac.in (B.V. Raghav) Newsgroups: gmane.emacs.help Subject: Re: HTML img tags Date: Wed, 14 Dec 2016 14:35:08 +0530 Organization: Indian Institute of Technology, Kanpur Message-ID: <87y3zig9tn.fsf@ram.bvr.dp.lan> References: <8xxoa0johe9.fsf@village.keycorner.org> <20161213234432.000a8c5604beab72f9907317@speakeasy.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481706353 27581 195.159.176.226 (14 Dec 2016 09:05:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 09:05:53 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: "James K. Lowden" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 14 10:05:44 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 1cH5VO-0005E8-GT for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 10:05:42 +0100 Original-Received: from localhost ([::1]:46332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH5VR-0002V4-8l for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 04:05:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH5V1-0002RA-Fl for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 04:05:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cH5Uy-00053l-CU for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 04:05:19 -0500 Original-Received: from mail3.iitk.ac.in ([202.3.77.190]:53060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH5Uy-00051h-2K for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 04:05:16 -0500 Original-Received: from smtp.cc.iitk.ac.in (smtp.cc.iitk.ac.in [172.31.1.22]) by mail3.iitk.ac.in (Postfix) with ESMTP id DFC2910000AD; Wed, 14 Dec 2016 14:35:08 +0530 (IST) Original-Received: from ram.bvr.dp.lan.iitk.ac.in (unknown [172.20.240.26]) (Authenticated sender: bvraghav) by smtp.cc.iitk.ac.in (Postfix) with ESMTPA id D0E0A53; Wed, 14 Dec 2016 14:35:08 +0530 (IST) In-Reply-To: <20161213234432.000a8c5604beab72f9907317@speakeasy.net> (James K. Lowden's message of "Tue, 13 Dec 2016 23:44:32 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 202.3.77.190 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:111949 Archived-At: "James K. Lowden" writes: > 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 > Apt mention of the utility. It is quick enough as well. I prefer bash to awk, but that hardly counts. Here is a throw-away bash function that does the hop img_size_attribs () { DIMS=`identify $1 | cut -d\ -f3` WIDTH=`echo $IDENT | cut -dx -f1` HEIGHT=`echo $IDENT | cut -dx -f2` echo -n "width=\"$WIDTH\" height=\"$HEIGHT\"" } -- (B.V. Raghav)