<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,7 +21,10 @@ if (intval(@$_GET['x'])) {
 }
 
 // name of the mask file
-$file = $cachedir . $x . '.png';
+$file = $cachedir . $x;
+$file.= (@$_GET['type'] === 'h') ? 'h' : '';
+$file.= '.png';
+
 
 // if in the cache, serve
 if (file_exists($file) &amp;&amp; $cache_on) {
@@ -35,23 +38,37 @@ if (file_exists($file) &amp;&amp; $cache_on) {
 $xplus = 3 * $x;
 
 // new GD image
-$im = @imagecreatetruecolor($xplus, $xplus)
+$xsize = $xplus;
+if (@$_GET['type'] === 'h') {
+    $xsize = 1;
+    $xsize = 3 * $xsize;
+}
+
+$im = @imagecreatetruecolor($xsize, $xplus)
        or die('Cannot Initialize new GD image stream');
 imagealphablending($im, false);
 imagesavealpha($im, true);
 // background
 $back = imagecolorallocatealpha($im, 255, 255, 255, 127);
-imagefilledrectangle($im, 0, 0, $xplus, $xplus, $back);
+imagefilledrectangle($im, 0, 0, $xsize, $xplus, $back);
 // forecolor
 $color = imagecolorallocatealpha($im, 255, 255, 255, 90);
-imagefilledellipse($im, $xplus / 2, 0, 1.7 * $xplus, $xplus, $color);
+
+switch(@$_GET['type']) {
+    case 'h':
+        imagefilledrectangle($im, 0, 0, $xsize, $xplus/2, $color);
+        break;
+    default:
+        imagefilledellipse($im, $xplus / 2, 0, 1.7 * $xplus, $xplus, $color);
+}
 imagepng($im, $file);
 imagedestroy($im);
 
 // a bunch of command-line tools to resize, PNG8-convert and optimize
 $cmd = array();
 // imagemagick resize
-$cmd[] = &quot;convert $file -thumbnail $xx$x $file.png&quot;;
+$n = $xsize / 3;
+$cmd[] = &quot;convert $file -thumbnail &quot; . $n . &quot;x&quot; . $x . &quot; $file.png&quot;;
 // crush the image
 $cmd[] = &quot;~/bin/pngcrush -rem alla $file.png $file&quot;;
 // convert to PNG8 </diff>
      <filename>mask/mask.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e6a0173b5419a8ecaddd4c63e5125ae4fcccdd80</id>
    </parent>
  </parents>
  <author>
    <name>Stoyan Stefanov</name>
    <email>stoyan@cpe-76-168-192-7.socal.res.rr.com</email>
  </author>
  <url>http://github.com/stoyan/etc/commit/907a8e63439a056834013c60dc49deec16eb38a4</url>
  <id>907a8e63439a056834013c60dc49deec16eb38a4</id>
  <committed-date>2009-02-21T23:24:54-08:00</committed-date>
  <authored-date>2009-02-21T23:24:54-08:00</authored-date>
  <message>added option &amp;type=h to generate 1 by X images, half (X/2) semi-trasparent</message>
  <tree>3ebb01085cd7e9a54d12f91a9e10d28c50ffe7bb</tree>
  <committer>
    <name>Stoyan Stefanov</name>
    <email>stoyan@cpe-76-168-192-7.socal.res.rr.com</email>
  </committer>
</commit>
