Image-Magick-Brand
view release on metacpan or search on metacpan
package Image::Magick::Brand;
use strict;
use warnings;
use Carp;
require Image::Magick;
our $VERSION = '0.01';
sub new {
my $class = shift;
my $self = bless {}, $class;
}
sub debug {
my $self = shift;
warn "Target : $target\n";
warn "Output : $output\n";
warn "Gravity : $gravity\n";
warn "Composite : $composite\n";
warn "Quality : $quality\n";
warn "Format : $format\n";
}
eval {
my $im_s = new Image::Magick;
my $im_t = new Image::Magick;
my $err;
open(IMAGE,"<$source") or carp "Could not open source image: $source ($!)" and return undef;
$err = $im_s->Read(file=>\*IMAGE);
die $err if $err;
close(IMAGE);
open(IMAGE,"<$target") or carp "Could not open target image: $target ($!)" and return undef;
$err = $im_t->Read(file=>\*IMAGE);
}
return 1;
}
1;
__END__
=head1 NAME
Image::Magick::Brand - Perl extension for creating branded images with ImageMagick.
=head1 SYNOPSIS
use Image::Magick::Brand;
my $b = new Image::Magick::Brand;
$b->debug(1); # debugging statements on
# Required parameters
$b->brand( source => 'brand.png',
target => 'photo.jpg',
output => 'branded.jpg' );
# Required and optional parameters
$b->brand( source => 'brand.png',
+---------+ +---------+
| | | |
| | | |
| | | +--+ |
+--+ | | | | | |
| | + | | = | +--+ |
+--+ +---------+ +---------+
=head1 PREREQUISITES
C<Image::Magick>
=cut
=head1 PARAMETERS
=head2 REQUIRED PARAMETERS
=over 4
=item source
=head1 EXPORT
None by default.
=head1 VERSION HISTORY
Version 0.01 (03 May 2005): Initial Revision
=head1 SEE ALSO
L<Image::Magick>
L<Image::Magick::Thumbnail::Fixed>
http://imagemagick.org/script/perl-magick.php
=head1 AUTHOR
Adam Roth, E<lt>aroth@cpan.orgE<gt>
Originally developed for http://www.fetishcyclesfanclub.com. Let me know if you find this module useful.
=head1 COPYRIGHT AND LICENSE
Revision history for Perl extension Image::Magick::Brand.
0.01 Tue May 3 16:11:19 2005
- original version;
# This Makefile is for the Image::Magick::Brand extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.12 (Revision: 1.124) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# ABSTRACT_FROM => q[Brand.pm]
# AUTHOR => q[System Administrator <root@nonet>]
# NAME => q[Image::Magick::Brand]
# PREREQ_PM => { }
# VERSION_FROM => q[Brand.pm]
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm)
SO = dylib
EXE_EXT =
FULL_AR = /usr/bin/ar
VENDORARCHEXP = /Network/Library/Perl/5.8.1/darwin-thread-multi-2level
VENDORLIBEXP = /Network/Library/Perl/5.8.1
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
DIRFILESEP = /
NAME = Image::Magick::Brand
NAME_SYM = Image_Magick_Brand
VERSION = 0.01
VERSION_MACRO = VERSION
VERSION_SYM = 0_01
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION = 0.01
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
MAKEMAKER = /System/Library/Perl/5.8.1/ExtUtils/MakeMaker.pm
MM_VERSION = 6.12
MM_REVISION = 1.124
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Image/Magick/Brand
BASEEXT = Brand
PARENT_NAME = Image::Magick
DLBASE = $(BASEEXT)
VERSION_FROM = Brand.pm
OBJECT =
LDFROM = $(OBJECT)
LINKTYPE = dynamic
# Handy lists of source code files:
XS_FILES =
C_FILES =
O_FILES =
# --- MakeMaker manifypods section:
# --- Begin manifypods section:
POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
manifypods : pure_all \
Brand.pm \
Brand.pm
$(NOECHO) $(POD2MAN_EXE) --section=3 --perm_rw=$(PERM_RW)\
Brand.pm $(INST_MAN3DIR)/Image::Magick::Brand.$(MAN3EXT)
# --- End manifypods section --- #
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
Makefile.PL view on Meta::CPAN
use 5.008001;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'Image::Magick::Brand',
VERSION_FROM => 'Brand.pm', # finds $VERSION
PREREQ_PM => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'Brand.pm', # retrieve abstract from module
AUTHOR => 'System Administrator <root@nonet>') : ()),
);
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
Image::Magick
COPYRIGHT AND LICENCE
Put the correct copyright and licence information here.
Copyright (C) 2005 Adam Roth (aroth@cpan.org)
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Image::Magick::Brand - Perl extension for creating branded images with ImageMagick.</title>
<link rev="made" href="mailto:root@hampsten.nonet" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Image::Magick::Brand - Perl extension for creating branded images with ImageMagick.</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
use Image::Magick::Brand;
my $b = new Image::Magick::Brand;
$b->debug(1); # debugging statements on
# Required parameters
$b->brand( source => 'brand.png',
target => 'photo.jpg',
output => 'branded.jpg' );
# Required and optional parameters
$b->brand( source => 'brand.png',
| | | |
| | | |
| | | +--+ |
+--+ | | | | | |
| | + | | = | +--+ |
+--+ +---------+ +---------+</pre>
<p>
</p>
<hr />
<h1><a name="prerequisites">PREREQUISITES</a></h1>
<p><code>Image::Magick</code></p>
<p>
</p>
<hr />
<h1><a name="parameters">PARAMETERS</a></h1>
<p>
</p>
<h2><a name="required_parameters">REQUIRED PARAMETERS</a></h2>
<dl>
<dt><strong><a name="item_source">source</a></strong><br />
</dt>
<p>None by default.</p>
<p>
</p>
<hr />
<h1><a name="version_history">VERSION HISTORY</a></h1>
<p>Version 0.01 (03 May 2005): Initial Revision</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="/Image/Magick.html">the Image::Magick manpage</a></p>
<p><a href="/Image/Magick/Thumbnail/Fixed.html">the Image::Magick::Thumbnail::Fixed manpage</a></p>
<p><a href="http://imagemagick.org/script/perl-magick.php">http://imagemagick.org/script/perl-magick.php</a></p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Adam Roth, <<a href="mailto:aroth@cpan.org">aroth@cpan.org</a>></p>
<p>Originally developed for <a href="http://www.fetishcyclesfanclub.com.">http://www.fetishcyclesfanclub.com.</a> Let me know if you find this module useful.</p>
<p>
</p>
<hr />
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Image::Magick::Brand') };
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
test/test.pl view on Meta::CPAN
#!/usr/bin/perl -w
use Image::Magick::Brand;
my $b = new Image::Magick::Brand;
$b->debug(1);
$b->brand( source => "logo.png",
target => "photo.jpg",
output => "branded.jpg" );
print "\nOpen branded.jpg. If the logo is located on the lower left hand corner of the photo then everything should be
working.\n";
( run in 1.130 second using v1.01-cache-2.11-cpan-beeb90c9504 )