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

  • Home
  • SEARCH
  • 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 6043255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:52:46+00:00 2026-05-23T06:52:46+00:00

I have the code below, if i don’t use watermark it’s fine but when

  • 0

I have the code below, if i don’t use watermark it’s fine but when i use watermark, both the original pics and thumbnail become very small and , watermark happens on thumbnail, I want watermark on the original image, pls help

//UPLOAD IMAGE
        //some $config vars for image
        $config['upload_path'] = './images/blog';
        $config['allowed_types'] = 'gif|jpg|jpeg|png';
        $config['max_size'] = '0';
        $config['remove_spaces'] = true;
            $config['overwrite'] = false;
            $config['max_width'] = '0';
            $config['max_height'] = '0';

            $this->load->library('upload', $config);

            //upload main image
            if(!$this->upload->do_upload('photo')){
                $e = $this->upload->display_errors();
                print_r($e);
            }

            $image = $this->upload->data();


    //thumbnail creation start
            $config1['image_library'] = 'gd2';
            $config1['source_image'] = $image['full_path'];
            $config1['create_thumb'] = TRUE;
            $config1['maintain_ratio'] = TRUE;
            $config1['width'] = 75;
            $config1['height'] = 50;

            $this->load->library('image_lib', $config1);
            $this->image_lib->resize();
            //thumbnail creation ends


        $this->image_lib->clear();
        //$image = $this->upload->data();
        //start watermarking
        $config2['source_image'] = $image['full_path'];
        $config2['wm_text'] = 'Copyright 2011 myself';
        $config2['wm_type'] = 'text';
        $config2['wm_font_path'] = './system/fonts/FromWhereYouAre.ttf';
        $config2['wm_font_size'] = '16';
        $config2['wm_font_color'] = 'ffffff';
        $config2['wm_vrt_alignment'] = 'middle';
        $config2['wm_hor_alignment'] = 'center';
        $config2['wm_padding'] = '20';

        $this->load->library('image_lib');
        $this->image_lib->initialize($config);
        $this->image_lib->watermark();
        //end watermarking
  • 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-05-23T06:52:46+00:00Added an answer on May 23, 2026 at 6:52 am

    please try adding

            $config2['new_image'] = '';
    

    in the watermarking code

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written code below.but it will print this exception and i really don't
I have this code below. I don't know why inArray() doesn't output 0. Any
I have working code below for collision of two circles, but now I have
I have written below code in htaccess RewriteRule ^([a-zA-Z_-]+).php$ http://www.domain.com/myfile.php?page=inc- $1.php [NC] I don't
Please have a look at my code below. It's not working and I don't
Hi i have tried to convert the c++ code below to c# but i
The code below works fine but, in the textbox the decimal value has this
I met an interesting issue about C#. I have code like below. List<Func<int>> actions
I have example of code below. <script type=text/javascript src=assets/scripts/somescript.php>. </script> So, will my browser
So far i have got the code below which works lovely when trying an

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.