GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php to auto-watermark images? (https://gfy.com/showthread.php?t=912040)

d-null 06-22-2009 04:07 PM

php to auto-watermark images?
 
is it difficult to do? or is there an easy way to manually run a watermark utility on a linux server based folder of images, where it would only watermark images it hadn't watermarked already?

d-null 06-22-2009 04:08 PM

actually is there an open source code snippet you could recommend that might be integratable into an already existing image upload script?

d-null 06-22-2009 04:18 PM

found this, in case it helps someone else out too:

http://tips-scripts.com/?tip=watermark#tip

mrgica 06-22-2009 04:31 PM

I can not answer you, but I hope someone can, here is a bump for you.

I remember once in time asking almost the same questions here, but back then it was so much simple comparing to today. My stupid questions made me lots of cash over the years. I stop asking questions here and now my business are almost dead.......

Varius 06-22-2009 04:41 PM

Here's some quick code that should help you out:

Code:

$watermark = imagecreatefrompng("path/to/watermark/file/here);
imageAlphaBlending($watermark, false);
imageSaveAlpha($watermark, true);
$image_string = @file_get_contents($thumb_dest);
$image = @imagecreatefromstring($image_string);
$imageWidth=imageSX($image);
$imageHeight=imageSY($image);
$watermarkWidth=imageSX($watermark);
$watermarkHeight=imageSY($watermark);
$coordinate_X = ( $imageWidth - 5) - ( $watermarkWidth);
$coordinate_Y = ( $imageHeight - 5) - ( $watermarkHeight);
imagecopy($image, $watermark, $coordinate_X, $coordinate_Y, 0, 0, $watermarkWidth, $watermarkHeight);
imagejpeg ($image, $thumb_dest, 100);
imagedestroy($image);
imagedestroy($watermark);

Modify as needed of course.

fris 06-22-2009 05:49 PM

http://www.sitepoint.com/article/watermark-images-php/

GrouchyAdmin 06-22-2009 05:51 PM

Already in MY image upload script. ;)

fris 06-22-2009 06:01 PM

or you could just run a shell command

Code:

for i in *.jpg;do composite -gravity southeast watermark.png $i $i;done

d-null 06-22-2009 06:46 PM

thanks for the ideas :thumbsup


All times are GMT -7. The time now is 06:19 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123