the following snippet works for me in php (posting it here since its a bit different to RubbleWebs suggestions)
Code: Select all
//adjust waterfile
@exec("$convert".' "'.$waterfile.'" -channel A -evaluate multiply "'.$multiply.'" +channel A -resize "'.$water_resize.'" -unsharp "'.$unsharp.'" '
.' "'.$waterfile.'"', $output, $status);
// resize image
if ($config->enable_watermark) {
@exec("$convert".' "'.$origfile.'" -coalesce -resize "'.$resize.'" -unsharp "'.$unsharp.'" '
.' null: "'.$waterfile.'" '
.' -gravity "'.$position.'" -geometry "'.$geometry.'" -layers composite '
.' -quality "'.$quality.'" -layers optimize "'.$newfile.'"', $output, $status);
} else {
@exec("$convert".' "'.$origfile.'" -coalesce -resize "'.$resize.'" -unsharp "'.$unsharp.'" '
.' -quality "'.$quality.'" -layers optimize "'.$newfile.'" ', $output, $status);
}
Code: Select all
if ($config->enable_watermark) {
@exec("$convert".' "'.$origfile.'" -coalesce -resize "'.$resize.'" '
.' null: \( "'.$waterfile.'" -channel A -evaluate multiply "'.$multiply.'" +channel A -resize "'.$water_resize.'" \) -unsharp "'.$unsharp.'" '
.' -gravity "'.$position.'" -geometry "'.$geometry.'" -layers composite '
.' -quality "'.$quality.'" -layers optimize "'.$newfile.'"', $output, $status);
} else {
@exec("$convert".' "'.$origfile.'" -coalesce -resize "'.$resize.'" -unsharp "'.$unsharp.'" '
.' -quality "'.$quality.'" -layers optimize "'.$newfile.'" ', $output, $status);
}