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

Re: Re (2): HTML5 => png or HTML5 => jpg.



On Wednesday, July 09, 2014 08:54:53 AM peter@easthope.ca wrote:
> From:	"Weaver" <weaver@riseup.net>
> Date:	Tue, 8 Jul 2014 22:28:35 -0700
> 
> > ... what's wrong with just getting a screengrab,
> > then trimming it through the 'tolls' menu in GIMP. Then save it in your
> > preferred format.
> 
> For one or two pixel maps, yes.  In fact "gimp > File > Create
> 
> > From Webpage" opens the document without using a browser.
> 
> I might have explaned more about the requirement.  There is
> one HTML5 document.  From this, 14 pixel maps are created;
> then inserted back into the document.  Revisions of the
> primary document are expected.  If a revision affects the
> pixel maps they should be recreated and inserted again into
> the document.  So I want the process of creating and
> inserting pixel maps to be as automated as possible.
> Ideally it should be done by execution of just one script.
> Certainly creation of the pixel maps should be automated.
> Not sure I'll automate the insertion.

Below is a script I hacked up a while back. Given a list of Smoothwall CGI 
scripts to image, it grabs the main UI image using cutycapt and trims off any 
whitespace around it using convert (imagemagick), then does the same for the 
help page. The script works for pages that would fit on a monitor and for 
pages that would span 10 monitors.

So cutycapt and imagemagick are the two pkgs you need to automate the process.


--------
#! /bin/bash

while read page; do
  script=`basename $page`
  echo -n "$script "
  (
    cutycapt --delay=500 \
              --url="http://admin:123@10.81.1.1:81/cgi-bin/$page"; \
              --out=tmp/$script.png
    convert tmp/$script.png -bordercolor white -border 1x1 -trim \
                            +repage png/$script.png
    cutycapt --delay=500 \
             --min-width=500 \
             --url="http://admin:123@10.81.1.1:81/cgi-bin/help.cgi?$script"; \
             --out=tmp/help-$script.png
    convert tmp/help-$script.png -bordercolor white -border 1x1 -trim \
                                 +repage png/help-$script.png
  )&
done < cgi-scripts
--------


Reply to: