Resize before watermark?

See all posts See thread Reply

Re: Resize before watermark? new!
by colin, 17 years, 5 months ago
The class actually resizes before applying the watermark

Can you post your code here, and link to your sample pictures?Reply
Re: Resize before watermark? new!
by Ed, 17 years, 5 months ago
My code looks like this:

$MyObjectImg = new upload($_FILES['thumbfile']);
if ($MyObjectImg->uploaded) {
  $MyObjectImg->file_auto_rename = true;
  $MyObjectImg->file_overwrite = false;
  $MyObjectImg->file_safe_name = true;
  $MyObjectImg->image_x = 320;
  $MyObjectImg->image_y = 180;
  $MyObjectImg->image_ratio_crop = true;
  $MyObjectImg->image_convert = "jpg";
  $MyObjectImg->jpeg_quality = 85;
  $MyObjectImg->image_watermark = 'playbutton.png';
  $MyObjectImg->process($path);
  if ($MyObjectImg->processed)  {
    $uploaded = true;
    $thumbfilename = $MyObjectImg->file_dst_name;
  } else
    $uploaded = false;
  $MyObjectImg->clean();
}

The watermark image can ve viewed at http://www.edjeavons.co.uk/playbutton.png

It works fine if I upload an image that's already 320x180px, but for larger images the symptoms suggest that it's placing the watermark first and reducing.Reply