cotonti.com : Playing with stylish/rounded thumbnails https://www.cotonti.com Son konu mesajları Cotonti en Mon, 01 Dec 2025 14:46:36 -0000 Elgan
ive not been impressed

check out this tho

http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php#showpic]]>
Çrş, 20 Mayıs 2009 03:14:09 -0000
chobblr
edit: if you mean the border color you can just stick "transparent" in the color settings on the admin panel > PFS]]>
Çrş, 20 Mayıs 2009 01:48:31 -0000
Elgan
Unlike mine it seems to have a set colour background, where i was trying for a transparent background. im still playing.


css :D?]]>
Çrş, 20 Mayıs 2009 01:44:00 -0000
chobblr Çrş, 20 Mayıs 2009 01:22:43 -0000 Elgan
but it's not compleatee, was my first attempt. ive recently found better thumbnail classes, that look to work nice, ive not tried some yet.

not sure where i found it now

http://www.cotonti.com/pastebin/32]]>
Çrş, 20 Mayıs 2009 01:12:28 -0000
chobblr Sal, 19 Mayıs 2009 22:03:19 -0000 Elgan
THe lil function below i use after after making a thumbnail to round the corners of it. Posting it here as its still WIP. You can see some outcomes here:







More here

As you may notice on some conflicting colours (ie my hat) it still tries to make it transparent on the blend? Any ideas?

Note, i do know jpegs etc dont have an alpha channel, and some of you with poor browsers may get some issues.


function round_thumbnail($path)
{
	$extension = get_extension($path);
	switch($extension)
	{
		case 'gif':
			$image = imagecreatefromgif($path);
			break;

		case 'png':
			$image = imagecreatefrompng($path);
			break;

		default:
			$image = imagecreatefromjpeg($path);
			break;
	}

	// Get width and height
	$x = imagesx($image);
	$y = imagesy($image);

	// grey
	$grey = 0x007F7F7F;

	//  (black)
	$c_bg = 0x00000000;

	$new_img = imagecreatetruecolor($x,$y);
	imageFilledRectangle($new_img, 0,0, $x,$y, $grey);

	$step = 18;
	$angle = 40;
	// draw the head
	imagearc($new_img, $step, $step, $angle, $angle,  180, 270, $transparent);
	imagearc($new_img, $x - $step, $step, $angle, $angle,  270, 0, $transparent);
	imagearc($new_img, $x - $step,$y - $step, $angle, $angle,  0, 90, $transparent);
	imagearc($new_img, $step,$y - $step, $angle, $angle,  90, 180, $transparent);

	ImageFillToBorder($new_img,0,0,$transparent,$transparent);
	ImageFillToBorder($new_img,$x,$y,$transparent,$transparent);
	ImageFillToBorder($new_img,0,$y,$transparent,$transparent);
	ImageFillToBorder($new_img,$x,0,$transparent,$transparent);
	imagecolortransparent($new_img, $transparent);

	// so we only rplace on grey
	imagelayereffect($new_img, IMG_EFFECT_OVERLAY);

	imagecopy($new_img, $image, 0,0, 0,0, $x,$y);

	switch($extension)
	{
		case 'gif':
			imagegif($new_img, $path);
			break;

		case 'png':
			imagepng($new_img, $path);
			break;

		default:
			imagepng($new_img, $path);
			break;
	}

	imagedestroy($image);
	imagedestroy($new_img);
	return;
}


meh sorry ill comment it tomorrow. if any interest.

note i just used it like this:

	sed_createthumb($file_path, $thumbnail_path , $cfg['th_x'],$cfg['th_y'], $cfg['th_keepratio'], $thumbnail_extension, $filename, $file_size, $th_colortext, $cfg['th_textsize'], $th_colorbg, $cfg['th_border'], $cfg['th_jpeg_quality']);

	if(1)
	{
		round_thumbnail($thumbnail_path);
	}
]]>
Cum, 03 Nis 2009 10:29:04 -0000