Fork me on GitHub

Watermark image error  Bottom

  • Hello

    I need help with this script:

    $column = &$pntable['phones_subcategories_column'];
    $table = $pntable['phones_subcategories'];
    $column1 = &$pntable['phones_information_column'];
    $table1 = $pntable['phones_information'];

    $result2=$dbconn->Execute("SELECT $column[sid], $column[cid],
    $column[title], $column1[sid], $column1[lid], $column1[title], $column1[URL]
    FROM $table, $table1
    WHERE $column[sid] = $column1[sid] and $column[sid]= ".pnVarPrepForStore($sid)."");
    while(list($sid, $cid, $title, $lsid, $llid, $ltitle, $URL)=$result2->fields) {
    $result2->MoveNext();

    OpenTable2();
    $image_name = $URL;//full path to image, path are added to database
    $wallname = "images/watermark.gif";
    $image_size = getimagesize($image_name);
    $wall_size = getimagesize($wallname);
    $image = imagecreatetruecolor($image_size[0],$image_size[1]);
    $image = imagecreatefromjpeg($image_name);
    $wallmark = imagecreatefromgif($wallname);
    imagecopymerge($image,$wallmark,10,350,0,0,$wall_size[0],$wall_size[1],100);
    imagedestroy($wallmark);

    header( "Content-type: image/jpeg");
    imagejpeg($image);
    CloseTable2();

    }

    The problem: if i use this script in a postnuke page, i get error (i mean a lot of strange text and no image). In a normal page without any HTML tags and $image_name set it to a "usual" image (like "modules/ModuleName/image.jpg) it's work perfect. What could be the problem?

    Thanks
  • Anybody? I really need help with this problem...
  • Can you show us the code that includes this image.

    Looks like you may be trying to display the image in-line. It should be part of an 'IMG' tag.
  • Here is the full code:




    and you can see an example of error received here:

    http://www.my3gmobil…wtest&lid=43&sid=13
  • I still ask for help here. Can anybody help me, please? i try with img src, without img src, and every other options..nothing work...please, did anybody have a good script to watermark dynamic images and fully functional in postnuke pages?
  • I looked at your site. You are trying to output the image data inline with the rest of the HTML code. This doesn't work.

    The 'src=' attribute can point to a static image, but you want to add a watermark. To do this the 'src=' attribute has to point to PHP code that reads to image and adds the watermark.

This list is based on users active over the last 60 minutes.