if (exists $imgdefaults{$params{page}}) {
foreach my $key (keys %{$imgdefaults{$params{page}}}) {
if (! exists $params{$key}) {
if (exists $imgdefaults{$params{page}}) {
foreach my $key (keys %{$imgdefaults{$params{page}}}) {
if (! exists $params{$key}) {
my $imglink;
my $r = $im->Read($srcfile);
error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
my $imglink;
my $r = $im->Read($srcfile);
error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
$im = Image::Magick->new;
$r = $im->Read($outfile);
error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
$im = Image::Magick->new;
$r = $im->Read($outfile);
error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
}
else {
($dwidth, $dheight)=($w, $h);
$r = $im->Resize(geometry => "${w}x${h}");
error sprintf(gettext("failed to resize: %s"), $r) if $r;
}
else {
($dwidth, $dheight)=($w, $h);
$r = $im->Resize(geometry => "${w}x${h}");
error sprintf(gettext("failed to resize: %s"), $r) if $r;
if (! $params{preview}) {
my @blob = $im->ImageToBlob();
writefile($imglink, $config{destdir}, $blob[0], 1);
if (! $params{preview}) {
my @blob = $im->ImageToBlob();
writefile($imglink, $config{destdir}, $blob[0], 1);
- (exists $params{alt} ? ' alt="'.$params{alt}.'"' : '').
- (exists $params{title} ? ' title="'.$params{title}.'"' : '').
- (exists $params{align} ? ' align="'.$params{align}.'"' : '').
- (exists $params{class} ? ' class="'.$params{class}.'"' : '').
- (exists $params{id} ? ' id="'.$params{id}.'"' : '').
+ $attrs.
+ (exists $params{align} && ! exists $params{caption} ? ' align="'.$params{align}.'"' : '').
add_depends($params{page}, $b, deptype("presence"));
$imgtag=htmllink($params{page}, $params{destpage},
$params{link}, linktext => $imgtag,
add_depends($params{page}, $b, deptype("presence"));
$imgtag=htmllink($params{page}, $params{destpage},
$params{link}, linktext => $imgtag,