help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTML img tags


From: B.V. Raghav
Subject: Re: HTML img tags
Date: Wed, 14 Dec 2016 14:35:08 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

"James K. Lowden" <address@hidden> 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]