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 7513567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:13:27+00:00 2026-05-30T00:13:27+00:00

I want to be able to generate a different image (with watermark) when the

  • 0

I want to be able to generate a different image (with watermark) when the user save the image.

I know that :

  • Broswer send text/html when it’s direct image access and image/jpeg (image content-type) when it’s included in a src=””

So if the browser query the server from a src=””, it send the good content-type. If the broswer go on the image url it does send text/html,application/html+xml, etc…

Anyone know how to make the watermark happen if the user do the command “Save as” ?

Thanks

  • 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-30T00:13:28+00:00Added an answer on May 30, 2026 at 12:13 am

    The most elegant solution gave above was to create a box over the image who’s less higher (and will hide the watermark) who’s has been generated before (when uploading the picture let’s say).

    This way the CSS hide the white box below the picture and when someone use “Save as” the box is there. No ressource is used on the server.

    Here’s the solution based on the browser header I developped. Do not work with “Save as” but work for direct access picture and src=””

        <?php
        #...
    
        # Require PHP to work as a module in apache
        $SentHeaders = apache_request_headers();
        #$Watermark = strpos($SentHeaders['Accept'], 'text');
        $Watermark = preg_match_all('/text/', $SentHeaders['Accept'], $matches);
    
        # Set the header
        header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
        header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
        header('Cache-Control: no-store, no-cache, must-revalidate');
        header('Cache-Control: post-check=0, pre-check=0', false);
        header('Pragma: no-cache'); 
    
        # HHeader required
        ($Image->ContentType) ? header('Content-Type: '.$Image->ContentType) : header('Location: /404');
    
        # Accès direct / save as
        if($Watermark){
            # Direct Image Access
            #...
        } else {
            # Image included in src=""
            #...
        }
        #...
        ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to generate a highly graphical (with lots of text
to export some data i want to be able to generate an html output.
I want to be able to generate PDF output from my (native) C++ Windows
Original Question I want to be able to generate a new (fully valid) MP3
I want to be able to capture the exception that is thrown when a
i want to generate an ID card for various group members belonging to different
Image that I have a huge database which stores threads and posts from different
I want to be able to map a path to a different domain but
In my C++ program, I want to be able to add some text over
I want to make a report, in which I want that user must be

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.