blob: 2ccf8771c50ade597db3dd39963da3de6e06b951 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001package Image::Magick;
2
3# Released Feb. 17, 1997 by Kyle Shorter (magick@wizards.dupont.com)
4# Public Domain
5
6use strict;
7use Carp;
8use vars qw($VERSION @ISA @EXPORT $AUTOLOAD);
9
10require 5.002;
11require Exporter;
12require DynaLoader;
13require AutoLoader;
14
15@ISA = qw(Exporter DynaLoader);
16# Items to export into callers namespace by default. Note: do not export
17# names by default without a very good reason. Use EXPORT_OK instead.
18# Do not simply export all your public functions/methods/constants.
19@EXPORT =
20 qw(
21 Success Transparent Opaque QuantumDepth QuantumRange MaxRGB
22 WarningException ResourceLimitWarning TypeWarning OptionWarning
23 DelegateWarning MissingDelegateWarning CorruptImageWarning
24 FileOpenWarning BlobWarning StreamWarning CacheWarning CoderWarning
25 ModuleWarning DrawWarning ImageWarning XServerWarning RegistryWarning
26 ConfigureWarning ErrorException ResourceLimitError TypeError
27 OptionError DelegateError MissingDelegateError CorruptImageError
28 FileOpenError BlobError StreamError CacheError CoderError
29 ModuleError DrawError ImageError XServerError RegistryError
30 ConfigureError FatalErrorException
31 );
32
cristyd934d102009-10-10 12:55:13 +000033$VERSION = '6.5.7';
cristy3ed852e2009-09-05 21:47:34 +000034
35sub AUTOLOAD {
36 # This AUTOLOAD is used to 'autoload' constants from the constant()
37 # XS function. If a constant is not found then control is passed
38 # to the AUTOLOAD in AutoLoader.
39
40 my $constname;
41 ($constname = $AUTOLOAD) =~ s/.*:://;
42 die "&${AUTOLOAD} not defined. The required ImageMagick libraries are not installed or not installed properly.\n" if $constname eq 'constant';
43 my $val = constant($constname, @_ ? $_[0] : 0);
44 if ($! != 0) {
45 if ($! =~ /Invalid/) {
46 $AutoLoader::AUTOLOAD = $AUTOLOAD;
47 goto &AutoLoader::AUTOLOAD;
48 }
49 else {
50 my($pack,$file,$line) = caller;
51 die "Your vendor has not defined PerlMagick macro $pack\:\:$constname, used at $file line $line.\n";
52 }
53 }
54 eval "sub $AUTOLOAD { $val }";
55 goto &$AUTOLOAD;
56}
57
58bootstrap Image::Magick $VERSION;
59
60# Preloaded methods go here.
61
62sub new
63{
64 my $this = shift;
65 my $class = ref($this) || $this || "Image::Magick";
66 my $self = [ ];
67 bless $self, $class;
68 $self->set(@_) if @_;
69 return $self;
70}
71
72sub New
73{
74 my $this = shift;
75 my $class = ref($this) || $this || "Image::Magick";
76 my $self = [ ];
77 bless $self, $class;
78 $self->set(@_) if @_;
79 return $self;
80}
81
82# Autoload methods go after =cut, and are processed by the autosplit program.
83
84END { UNLOAD () };
85
861;
87__END__
88
89=head1 NAME
90
91Image::Magick - Perl extension for calling ImageMagick's libMagick methods
92
93=head1 SYNOPSIS
94
95 use Image::Magick;
96 $p = new Image::Magick;
97 $p->Read("imagefile");
98 $p->Set(attribute => value, ...)
99 ($a, ...) = $p->Get("attribute", ...)
100 $p->routine(parameter => value, ...)
101 $p->Mogrify("Routine", parameter => value, ...)
102 $p->Write("filename");
103
104=head1 DESCRIPTION
105
106This Perl extension allows the reading, manipulation and writing of
107a large number of image file formats using the ImageMagick library.
108It was originally developed to be used by CGI scripts for Web pages.
109
110A Web page has been set up for this extension. See:
111
cristyd934d102009-10-10 12:55:13 +0000112 file:///usr/local/share/doc/ImageMagick-6.5.7/www/perl-magick.html
cristy3ed852e2009-09-05 21:47:34 +0000113 http://www.imagemagick.org/script/perl-magick.php
114
115=head1 AUTHOR
116
117Kyle Shorter magick-users@imagemagick.org
118
119=head1 BUGS
120
121Has all the bugs of ImageMagick and much, much more!
122
123=head1 SEE ALSO
124
125perl(1).
126
127=cut