#!/usr/bin/perl
#
# Name:
#	im-hax-border-1.pl.
#
# Purpose:
#	Demonstrate the Border.
#
# V 1.02 06-Jun-2006
# ------------------
# o Upgrade ImageMagick from V 5.4.7 to V 6.2.8
# o Re-check all hax
#
# V 1.01 20-Feb-2002
# ------------------
# o Output to same dir as other hax
#
# V 1.00 1-Oct-2001
# -----------------
# o Initial version
#
# Test environment:
#	OS: WinXP SP2
#	Web server: Apache/2.0.54
#	ImageMagick: V 6.2.8
#
# Input files:
#	o /apache/htdocs/im/logo.jpg
#
# Output files:
#	o /apache/htdocs/im/im-hax-border-1.png
#
# Note:
#	o tab = 4 spaces || die.
#	o Text reformatted to max 50 chars wide
#		so source can be converted to PDF
#
# Author:
#	Ron Savage <ron@savage.net.au>
#	http://savage.net.au/ImageMagick.html
#
# Licence:
#	Copyright (c) 1999-2002 Ron Savage
#
#	All Programs of mine are
#	'OSI Certified Open Source Software';
#	you can redistribute them and/or modify them
#	under the terms of the Artistic License,
#	a copy of which is available at:
#	http://www.opensource.org/licenses/index.html

use strict;
use warnings;

use Image::Magick;

# -----------------------------------------------

my($im_version) = $Image::Magick::VERSION;
print "Image::Magick V $im_version. \n";

my($doc_root_name)		= '/apache2/htdocs/im';
my($input_file_name)	=
	$doc_root_name . '/logo.jpg';
my($output_file_name)	=
	$doc_root_name . '/im-hax-border-1.png';
my($image)				= Image::Magick -> new();
my($result)				=
	$image -> Read($input_file_name);
warn $result if $result;

$result	= $image -> Border
(
	width	=> 4,
	height	=> 4,
	fill	=> 'red',
);
warn $result if $result;

$result = $image -> Write($output_file_name);
warn $result if $result;
print "Success. Wrote $output_file_name. \n";
