Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8245603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:14:00+00:00 2026-06-07T22:14:00+00:00

Im using Ajax Crop from enter link description here and I’d like to add

  • 0

Im using Ajax Crop from enter link description here and I’d like to add a watermark to the script. The following is my script.

WATERMARK

$image_path = "watermark.png";

function watermark_image($oldimage_name, $new_image_name){
    global $image_path;
    list($owidth,$oheight) = getimagesize($oldimage_name);
    $width = 500; $height = 100;    
    $im = imagecreatetruecolor($width, $height);
    $img_src = imagecreatefromjpeg($oldimage_name);
    imagecopyresampled($im, $img_src, 0, 0, 0, 0, $width, $height, $owidth, $oheight);
    $watermark = imagecreatefrompng($image_path);
    list($w_width, $w_height) = getimagesize($image_path);        
    $pos_x = $width - $w_width; 
    $pos_y = $height - $w_height;
    imagecopy($im, $watermark, $pos_x, $pos_y, 0, 0, $w_width, $w_height);
    imagejpeg($im, $new_image_name, 100);
    imagedestroy($im);
    unlink($oldimage_name);
    return true;
}

UPLOAD AND RESIZE PART

function resizeThumb($arr){

    $date = md5(time());    
    $arr['temp_uploadfile'] = $arr['img_src'];
$arr['new_uploadfile'] = $arr['uploaddir'].strtolower($date).'.jpg';

    asidoImg($arr);
    exit;
}

I tried adding

$arr = watermark_image($arr[‘temp_uploadfile’],
$arr[‘uploaddir’].strtolower($date).’.jpg’);

in place of

$arr[‘new_uploadfile’] = $arr[‘uploaddir’].strtolower($date).’.jpg’;

but this didnt work.

Could someone help me?

Download the files and test

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:14:04+00:00Added an answer on June 7, 2026 at 10:14 pm

    It turns out the script uses ASIDO and it has a built in WATERMARK TOOL.
    In func.php I done the following.

    function asidoImg2($arr){
    
        include('asido/class.asido.php');
        asido::driver('gd');
    
        $height     = $arr['height'];
        $width      = $arr['width'];
        $x          = $arr['x'];
        $y          = $arr['y'];                
    
        // process
        $i1 = asido::image($arr['temp_uploadfile'], $arr['new_uploadfile']);    
        // fit and add white frame                                      
        if($arr['thumb'] === true){
            Asido::Crop($i1, $x, $y, $width, $height);
        asido::watermark($i1, 'watermark.png', ASIDO_WATERMARK_MIDDLE_LEFT, ASIDO_WATERMARK_SCALABLE_ENABLED, 1);
    
        }
        else{
            Asido::Frame($i1, $width, $height, Asido::Color(255, 255, 255));            
        asido::watermark($i1, 'watermark.png', ASIDO_WATERMARK_MIDDLE_LEFT, ASIDO_WATERMARK_SCALABLE_ENABLED, 1);
        }
    
        // always convert to jpg    
        Asido::convert($i1, 'image/jpg');
    
        $i1->Save(ASIDO_OVERWRITE_ENABLED);
            $data = array(
            'photo'=> $arr['new_uploadfile']
          );
            // echo $user_id;
        // delete old file
        echo $data['photo'];    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using AJAX to get data for several business-card like divs on my page
I am using ajax calendar extender for 'From date' and 'To date' text box,
I'm using ajax login script in my store, so i'm using below script to
I'm trying to develop image crop using JQuery. I use ajax to upload the
I was using Ajax.Pager in MVC 2 which worked fine.Here is the code in
Using Ajax.ActionLink's OnSuccess-Event brings me some trouble. As asked here the function cannot be
I have am using ajax to retun a array [[int,string],....] in index.json. Here is
Im using ajax .POST to run php script that suppose to return true/false. Im
Im using ajax to call php which gets results from a mysql db. Reason
I am using ajax to connect to a PHP script and then retrieve the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.