| 1 |
#!/usr/bin/perl |
| 2 |
# |
| 3 |
# An example of applying many settings in preparation for image creation. |
| 4 |
# |
| 5 |
# Extracted from PerlMagick Discussion forums.. |
| 6 |
# Gravity center, caption and wrapped text |
| 7 |
# https://imagemagick.org/discourse-server/viewtopic.php?f=7&t=17282 |
| 8 |
# |
| 9 |
use strict; |
| 10 |
use warnings; |
| 11 |
use Image::Magick; |
| 12 |
|
| 13 |
my $im = new Image::Magick; |
| 14 |
my $e = $im->Set( |
| 15 |
background => 'none', |
| 16 |
fill => 'white', |
| 17 |
stroke => 'black', |
| 18 |
strokewidth => 2, |
| 19 |
Gravity => 'East', |
| 20 |
pointsize => 48, |
| 21 |
size => '200x300', |
| 22 |
); |
| 23 |
die $e if $e; |
| 24 |
|
| 25 |
$e = $im->Read("caption:Lorem ipsum etc etc"); |
| 26 |
die $e if $e; |
| 27 |
|
| 28 |
$e = $im->Trim(); |
| 29 |
die $e if $e; |
| 30 |
|
| 31 |
$e = $im->Write('settings.pam'); |
| 32 |
die $e if $e; |