watermarking and resizing (animated) images

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
cassy

Re: watermarking and resizing (animated) images

Post by cassy »

cool ! all working now !

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);
}
or as all in one:

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);
}
Post Reply