<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Playing with stylish/rounded thumbnails</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Wed, 20 May 2026 23:36:45 -0000</pubDate>

		<item>
			<title>Elgan</title>
			<description><![CDATA[k...<br />
<br />
ive not been impressed<br />
<br />
check out this tho<br />
<br />
<a href="http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php#showpic" rel="nofollow">http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php#showpic</a>]]></description>
			<pubDate>Wed, 20 May 2009 03:14:09 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2536&d=0#post12664]]></link>
		</item>
		<item>
			<title>chobblr</title>
			<description><![CDATA[a transparent background for what ?<br />
<br />
edit: if you mean the border color you can just stick &quot;transparent&quot; in the color settings on the admin panel &gt; PFS]]></description>
			<pubDate>Wed, 20 May 2009 01:48:31 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2536&d=0#post12663]]></link>
		</item>
		<item>
			<title>Elgan</title>
			<description><![CDATA[im just trying it now.<br />
<br />
Unlike mine it seems to have a set colour background, where i was trying for a transparent background.  im still playing.<br />
<br />
<br />
css :D?]]></description>
			<pubDate>Wed, 20 May 2009 01:44:00 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2536&d=0#post12661]]></link>
		</item>
		<item>
			<title>chobblr</title>
			<description><![CDATA[does the above link (to code) output look good ?]]></description>
			<pubDate>Wed, 20 May 2009 01:22:43 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2536&d=0#post12660]]></link>
		</item>
		<item>
			<title>Elgan</title>
			<description><![CDATA[errm anywhere thats loaded, functions.php if u wish. Then just call it.<br />
<br />
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.<br />
<br />
not sure where i found it now<br />
<br />
<a href="http://www.cotonti.com/pastebin/32">http://www.cotonti.com/pastebin/32</a>]]></description>
			<pubDate>Wed, 20 May 2009 01:12:28 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2536&d=0#post12657]]></link>
		</item>
		<item>
			<title>chobblr</title>
			<description><![CDATA[Where do i put this code ?]]></description>
			<pubDate>Tue, 19 May 2009 22:03:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2536&d=0#post12653]]></link>
		</item>
		<item>
			<title>Elgan</title>
			<description><![CDATA[Okei so today i didnt get much work on actual things done, spent pretty much all the day after work researching and getting to know GD a little more and playing about and breaking up with some girl again. so anyway: GD has alot of funcs , i wanted to get to know it a little more in deph. now im tired, angry, and dont care anymore , work int he morning and thought it would be nicer to just share and chat!<br />
<br />
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:<br />
<br />
<a href="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-Green_Sea_Turtle.jpg" rel="nofollow"><img src="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-Green_Sea_Turtle.jpg" alt="" class="scale" /></a><br />
<a href="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-Humpback_Whale.jpg" rel="nofollow"><img src="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-Humpback_Whale.jpg" alt="" class="scale" /></a><br />
<a href="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-Toco_Toucan.jpg" rel="nofollow"><img src="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-Toco_Toucan.jpg" alt="" class="scale" /></a><br />
<a href="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-elgan_1.jpg" rel="nofollow"><img src="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-elgan_1.jpg" alt="" class="scale" /></a><br />
<a href="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-dalahast-preview.png" rel="nofollow"><img src="http://www.mods-r-us.net/demo/datas/medialibrary/1/thumbs/thumb-dalahast-preview.png" alt="" class="scale" /></a><br />
<br />
<a href="http://www.mods-r-us.net/demo/plug.php?e=medialibrary&amp;category=2" rel="nofollow">More here</a><br />
<br />
As you may notice on some conflicting colours (ie my hat) it still tries to make it transparent on the blend? Any ideas?<br />
<br />
Note, i do know jpegs etc dont have an alpha channel, and some of you with poor browsers may get some issues.<br />
<br />
<br />
<div class="highlight"><pre class="php">
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;
}
</pre></div>
<br />
<br />
meh sorry ill comment it tomorrow. if any interest.<br />
<br />
note i just used it like this:<br />
<br />
<div class="highlight"><pre class="php">	sed_createthumb($file_path, $thumbnail_path , $cfg&#091;'th_x'&#093;,$cfg&#091;'th_y'&#093;, $cfg&#091;'th_keepratio'&#093;, $thumbnail_extension, $filename, $file_size, $th_colortext, $cfg&#091;'th_textsize'&#093;, $th_colorbg, $cfg&#091;'th_border'&#093;, $cfg&#091;'th_jpeg_quality'&#093;);

	if(1)
	{
		round_thumbnail($thumbnail_path);
	}
</pre></div>]]></description>
			<pubDate>Fri, 03 Apr 2009 10:29:04 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2536&d=0#post10939]]></link>
		</item>
	</channel>
</rss>