watermarking and resizing (animated) images
Posted: 2010-09-02T03:53:43-07:00
hi there,
I am currently trying to modify a Joomla component to support IM for image uploads incl animated gifs
$waterfile = is a partially transparent png file ftp'd to a predefined location, created by me on my local puter (size 32x32px - the site's logo)
$origfile = is the original image (png, jpg, animated gif) created by a submitter on their local puter (any size eg 1280:850)
the component to allows both display of thumbs and large images
large images are set to max width / height : 1000/700px
thumbs are set to max width / height : 250 / 200px
IM should be used for watermarking and resizing the uploaded image preserving possible animations with $waterfile being added to the bottom left corner of $origfile
for resizing images I have so far:
$commands = ' -coalesce -resize "'.$thumb_w.'x'.$thumb_h.'" -quality "'.$quality.'" -unsharp "2x1.4+1.7+0.07"';
$convert = $this->_escapeshellcmd($path . 'convert').' "'.$origfile.'" '.$commands.' "'.$newfile.'" ';
$output = null;
$status = null;
@exec($convert, $output, $status);
while I have read
http://www.imagemagick.org/Usage/annota ... ark_symbol
http://www.imagemagick.org/Usage/annota ... mark_image
this does not quite seem to be what I'm looking for
and while this
http://www.imagemagick.org/Usage/anim_mods/#annotating
is making a lot more sense - I could use it both for animated and non-animated images -
-annotate appears to only be for adding text to an (animated) image while I would like to use a partially transparent png
when should the watermark be added? before or after resizing the image?
is it possible to add the watermark only after having resized $origfile to the large image while at the same time adding the watermark to $origfile prior to resizing it ?
can it be included in the above snippet ? or would it require an additional snippet
Could somebody please help me out?
I would majorly appreciate you taking the time to do so.
------------------------------------------------------------------------------------------------------------
my setup: Joomla 1.5.20 / IM 6.3.7 - latest stable for Debian Lenny (according to my host)
I am currently trying to modify a Joomla component to support IM for image uploads incl animated gifs
$waterfile = is a partially transparent png file ftp'd to a predefined location, created by me on my local puter (size 32x32px - the site's logo)
$origfile = is the original image (png, jpg, animated gif) created by a submitter on their local puter (any size eg 1280:850)
the component to allows both display of thumbs and large images
large images are set to max width / height : 1000/700px
thumbs are set to max width / height : 250 / 200px
IM should be used for watermarking and resizing the uploaded image preserving possible animations with $waterfile being added to the bottom left corner of $origfile
for resizing images I have so far:
$commands = ' -coalesce -resize "'.$thumb_w.'x'.$thumb_h.'" -quality "'.$quality.'" -unsharp "2x1.4+1.7+0.07"';
$convert = $this->_escapeshellcmd($path . 'convert').' "'.$origfile.'" '.$commands.' "'.$newfile.'" ';
$output = null;
$status = null;
@exec($convert, $output, $status);
while I have read
http://www.imagemagick.org/Usage/annota ... ark_symbol
http://www.imagemagick.org/Usage/annota ... mark_image
this does not quite seem to be what I'm looking for
and while this
http://www.imagemagick.org/Usage/anim_mods/#annotating
is making a lot more sense - I could use it both for animated and non-animated images -
-annotate appears to only be for adding text to an (animated) image while I would like to use a partially transparent png
when should the watermark be added? before or after resizing the image?
is it possible to add the watermark only after having resized $origfile to the large image while at the same time adding the watermark to $origfile prior to resizing it ?
can it be included in the above snippet ? or would it require an additional snippet
Could somebody please help me out?
I would majorly appreciate you taking the time to do so.
------------------------------------------------------------------------------------------------------------
my setup: Joomla 1.5.20 / IM 6.3.7 - latest stable for Debian Lenny (according to my host)