.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CGI::Uploader::Transform::ImageMagick 3pm" .TH CGI::Uploader::Transform::ImageMagick 3pm "2022-06-10" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CGI::Uploader::Transform::ImageMagick \- generate thumbnails with ImageMagick .SH "METHODS" .IX Header "METHODS" .SS "\fBgen_thumb()\fP" .IX Subsection "gen_thumb()" .Vb 1 \& use CGI::Uploader::Transform::ImageMagick; .Ve .PP As a class method: .PP .Vb 5 \& ($thumb_tmp_filename) = CGI::Uploader::Transform::ImageMagick\->gen_thumb({ \& filename => $orig_filename, \& w => $width, \& h => $height \& }); .Ve .PP Within a CGI::Uploader \f(CW\*(C`spec\*(C'\fR: .PP .Vb 3 \& gen_files => { \& my_thumb => gen_thumb({ w => $width, h => $height }), \& } .Ve .PP Looking for a different syntax? See \*(L"\s-1BACKWARDS COMPATIBILITY\*(R"\s0 .PP This function creates a copy of given image file and resizes the copy to the provided width and height. .PP \&\f(CW\*(C`gen_thumb\*(C'\fR can be called as object or class method. As a class method, there there is no need to call \f(CW\*(C`new()\*(C'\fR before calling this method. .PP Graphics::Magick is used as the first choice image service module. Image::Magick is tried next. .PP Input: .PP .Vb 3 \& filename \- filename of source image \& w \- max width of thumbnail \& h \- max height of thumbnail .Ve .PP One or both of \f(CW\*(C`w\*(C'\fR or \f(CW\*(C`h\*(C'\fR is required. .PP Output: \- filename of generated tmp file for the thumbnail \- the initialized image generation object. (You generally shouldn't need this) .SH "BACKWARDS COMPATIBILITY" .IX Header "BACKWARDS COMPATIBILITY" These older, more awkward syntaxes are still supported: .PP As a class method: .PP .Vb 4 \& ($thumb_tmp_filename) = CGI::Uploader::Transform::ImageMagick\->gen_thumb( \& $orig_filename, \& [ w => $width, h => $height ] \& ); .Ve .PP In a \f(CW\*(C`CGI::Uploader\*(C'\fR \f(CW\*(C`spec\*(C'\fR: .PP \&'my_img_field_name' => { transform_method => \e&gen_thumb, params => [ w => 100, h => 100 ], } .PP 1;