g10dra / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

Patch for /trunk/timthumb.php #150

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Lines 80 and 81: add news parameters "$watermark" and "$pos".
$watermark: directory + name of image.
$pos: position of watermark in image. 
Lines 266 and 293: script that apply watermark e set the position.

Thanks.

Tiago
tiago.agostinho@gmail.com

Original issue reported on code.google.com by Tiago.Ag...@gmail.com on 26 Jan 2011 at 12:12

Attachments:

GoogleCodeExporter commented 8 years ago
Hi There, thanks for the suggestion. Whilst the idea is good, removing the 
watermark is as simple as removing the parameters from the TimThumb url. As 
such I am not sure this should be added, at least not in this way. I will have 
a think about possible better solutions.

Original comment by BinaryMoon on 14 Feb 2011 at 10:44

GoogleCodeExporter commented 8 years ago
just watermak on bottom - right:

add line 25:
define( 'WATERMARK_OVERLAY_IMAGE', 'watermark.png' ); // the watermark image

add after line 92 ($sharpen = (bool) get_request ('s', 0);):
$watermark = (bool) get_request ('wm', 0);

add before line 286 (// output image to browser based on mime type):
if ($watermark == 1)
{
    $overlay_gd_image = imagecreatefrompng( WATERMARK_OVERLAY_IMAGE );
    $overlay_width = imagesx( $overlay_gd_image );
    $overlay_height = imagesy( $overlay_gd_image );
    imagecopy( $canvas, $overlay_gd_image, $new_width - $overlay_width - 20, $new_height - $overlay_height - 20, 0, 0, $overlay_width, $overlay_height);
}

Original comment by bvi...@gmail.com on 11 Jul 2011 at 3:07

GoogleCodeExporter commented 8 years ago
Hello,

the Code works but not to transparent pngs on gd library...

Would you post a fixed code?

Original comment by chju...@googlemail.com on 7 Aug 2011 at 5:36

GoogleCodeExporter commented 8 years ago
You must set the alpha blending before imagecopy(...)
...
// Set the alpha blending
imagealphablending($canvas, true );
// Copy the PNG to the canvas
imagecopy(.........);
// Reset alpha blending
imagealphablending($canvas, false );
// Save alpha channel
imagesavealpha($canvas , true);

Original comment by adwo...@tpacenligne.com on 14 Sep 2011 at 2:47

GoogleCodeExporter commented 8 years ago
hi tiago can send the whole file? I fail to do what you command walk .. that 
version is? the testee in VERSION ', '2 .8.6
thank lopmultimedia@gmail.com

Original comment by lopmulti...@gmail.com on 6 Mar 2012 at 9:15

GoogleCodeExporter commented 8 years ago
Can this patch be merged in?

Original comment by Ju...@jerrickmedia.com on 30 Oct 2013 at 8:27