%%image-filter-editor-html%%
progmin : / (context #153)
2002-06-05 15:50:15

%%preprocess%%
$this->beryliumToForm(); 
$this->getRuntimeVars();

$tags= "";
$postvars= $GLOBALS['HTTP_POST_VARS'];

if ($postvars['modulatebri']=="") $this->modulatebri= 100;
else $this->modulatebri= $postvars['modulatebri'];
if ($postvars['modulatesat']=="") $this->modulatesat= 100;
else $this->modulatesat= $postvars['modulatesat'];
if ($postvars['modulatehue']=="") $this->modulatehue= 100;
else $this->modulatehue= $postvars['modulatehue'];
$tags.= "&modulatebri=$this->modulatebri&modulatesat=$this->modulatesat&modulatehue=$this->modulatehue";

if ($postvars['gaussian']=="") $this->gaussian= 0; 
else {
	$this->gaussian= $postvars['gaussian'];
	if ($postvars['gaussiansigma']=="") $this->gaussiansigma= 0;
	else $this->gaussiansigma= $postvars['gaussiansigma'];
	$tags.= "&gaussian=$this->gaussian&gaussiansigma=$this->gaussiansigma";
	}
	
if ($postvars['sharpen']=="") $this->sharpen= 0;
else {
	$this->sharpen= $postvars['sharpen'];
	if ($postvars['sharpensigma']=="") $this->sharpensigma= 0;
	else $this->sharpensigma= $postvars['sharpensigma'];
	$tags.= "&sharpen=$this->sharpen&sharpensigma=$this->sharpensigma";
	}
	
if ($postvars['spread']=="") $this->spread= 0;
else {
	$this->spread= $postvars['spread'];
	$tags.= "&spread=$this->spread";
	}
	
if ($postvars['median']=="") $this->median= 0;
else {
	$this->median= $postvars['median'];
	$tags.= "&median=$this->median";
	}

if ($postvars['normalize']=="") $this->normalize= 0;
else {
	$this->normalize= $postvars['normalize'];
	$tags.= "&normalize=$this->normalize";
	}
$enormalize= "normalize$this->normalize";
$this->{$enormalize}= "checked";

if ($postvars['negate']=="") $this->negate= 0;
else {
	$this->negate= $postvars['negate'];
	$tags.= "&negate=$this->negate";
	}
$enegate= "negate$this->negate";
$this->{$enegate}= "checked";

if ($postvars['monochrome']=="") $this->monochrome= 0;
else {
	$this->monochrome= $postvars['monochrome'];
	$tags.="&monochrome=$this->monochrome";
	}
$emonochrome= "monochrome$this->monochrome";
$this->{$emonochrome}= "checked";

if ($postvars['submit']=="filter") {
	$this->generating= "<p align=center class=notice>Generating preview now</p>";
	$this->previewTag= "<img src=\"$this->uri?method=mogrify$tags\" alt='preview with filtering' title='preview with filtering' onLoad=\"window.location='#preview';\">";
	}
else $this->previewTag= "Please fill in values above and click <tt>filter</tt>.";

if ($this->id!="") {
	$this->hiddenvars= "<input type='hidden' name='id' value=\"$this->id\"><input type='hidden' name='quality' value='80'>";
	}

// proper icon
if (!$this->public) $this->iconpvt= "-pvt";

// get this->filesize
if (file_exists($this->path)) {
	$size= filesize($this->path);
	if ($size<1024) {
		$this->filesize= "$size Bytes";
		}
	elseif ($size < 1048576) {
		$size= $size/1024;
		$size= round($size,2);
		$this->filesize= "$size KB";
		}
	else	{
		$size= $size/1048576;
		$size= round($size,2);
		$this->filesize= "$size MB";
		}
	}
else {
	$this->filesize= "file not found!";
	}
	
// setup for thumbnail
$this->proportion(150,100);
	


%%header%%


%%css%%
.notice	{color: #ff0000; }


%%template%%
$this->generating
<table border=0>
<tr>
<td valign='top'>
<table class='objHeader'>
	<tr>
		<td width='20'><img src='/bicons/spacer.png' border=0 alt=image width=20 height=1></td>
		<td><span class='objFlavor'>$this->flavor:</span></td>
	</tr>
	<tr>
		<td colspan=2>
			<span class='objTitle'>
			<img src='/bicons/image$this->iconpvt.png' border=0 alt='image:$this->id' title='image:$this->id' align=absmiddle>
			$this->title</span>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><span class='objByline'>By $this->authorTag on $this->created.</span>
			<span class='info'><br>Filesize: $this->filesize | Image size: $this->origWidth x $this->origHeight pixels</span> 
		</td>
	</tr>
</table>
</td>
<td width='150' align=center valign=middle><img src='$this->uri' width='$this->width' height='$this->height' alt='original image, scaled to thumbnail' title='original image, scaled to thumbnail'></td>
</tr>
</table>
<form method='post' action='$this->baseURL?method=filter$session->cgi' class='form'>
$this->hiddenvars
<table border='0' class='editTable'>
<tr>
	<td colspan=2 align='center'>
		<p>&nbsp</p>
		<table class='infoBar'>
			<tr>
				<td>Color Options</td>
			</tr>
		</table>	
	</td>
</tr>
<tr>
	<td align='right' valign='top'>brightness:</td>
	<td valign='top'><input type='text' name='modulatebri' size='3' maxlength='255' value="$this->modulatebri">%</td>
</tr>
<tr>
	<td align='right' valign='top'>saturation:</td>
	<td valign='top'><input type='text' name='modulatesat' size='3' maxlength='255' value="$this->modulatesat">%</td>
</tr>
<tr>
	<td align='right' valign='top'>hue:</td>
	<td valign='top'><input type='text' name='modulatehue' size='3' maxlength='255' value="$this->modulatehue">%</td>
</tr>
<tr>
	<td align='right' valign='top'>normalize:</td>
	<td valign='top'><input type=hidden name=normalize value=0><input type="checkbox" name="normalize" value="1" $this->normalize1> (contrast enhancement)</td>
</tr>
<tr>
	<td align='right' valign='top'>monochrome:</td>
	<td valign='top'><input type=hidden name=monochrome value=0><input type="checkbox" name="monochrome" value="1" $this->monochrome1> (makes image black-and-white)</td>
</tr>
<tr>
	<td align='right' valign='top'>negative:</td>
	<td valign='top'><input type=hidden name=negate value=0><input type="checkbox" name="negate" value="1" $this->negate1></td>
</tr>
<tr>
	<td colspan=2 align='center'>
		<p>&nbsp</p>
		<table class='infoBar'>
			<tr>
				<td>Blur/Sharpen Options</td>
			</tr>
		</table>	
	</td>
</tr>
<tr>
	<td align='right' valign='top'>blur:</td>
	<td valign='top'>radius <input type='text' name='gaussian' size='3' maxlength='255' value="$this->gaussian"> pixels with <input type='text' name='gaussiansigma' size='3' maxlength='255' value="$this->gaussiansigma"> deviation</td>
</tr>
<tr>
	<td align='right' valign='top'>sharpen:</td>
	<td valign='top'>radius <input type='text' name='sharpen' size='3' maxlength='255' value="$this->sharpen"> pixels with <input type='text' name='sharpensigma' size='3' maxlength='255' value="$this->sharpensigma"> deviation</td>
</tr>
<tr>
	<td align='right' valign='top'>pixel spread:</td>
	<td valign='top'><input type='text' name='spread' size='3' maxlength='255' value="$this->spread"> pixels (experimental)</td>
</tr>
<tr>
	<td align='right' valign='top'>median filter:</td>
	<td valign='top'><input type='text' name='median' size='1' maxlength='255' value="$this->median"> 0-6 (experimental)</td>
</tr>
<tr> 
	<td width=30%>&nbsp;</td>
	<td width=70%><input type='submit' name='submit' value='filter' class='buttonstyle'></td>
</tr>
</table>
</form>
<table border=0>
	<tr>
		<td width='1%'><img src='/bicons/spacer.png' border=0 alt=image width=20 height=1></td>
		<td width='99%'>
			<p class='info'><span class='objTitle'>Preview: </span><a name='preview'> </a><br>
			A preview will be generated using the settings above every time you click <tt>filter</tt>. To apply changes permanently, click <tt>commit</tt> below.<br>
			<b>Please be patient</b>, it may take up to a minute for berylium to generate the new image...</p></td>
	</tr>
	<tr>
		<td colspan=2>&nbsp;</td>
	</tr>
	<tr>
		<td colspan=2 align=center>
			$this->previewTag
		</td>
	</tr>
	<tr>
		<td colspan=2>&nbsp;</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td class='info'><form method='post' action='$this->uri?method=mogrify$session->cgi' class='form'>
				$this->hiddenvars
				<input type=hidden name=modulatebri value='$this->modulatebri'>
				<input type=hidden name=modulatesat value='$this->modulatesat'>
				<input type=hidden name=modulatehue value='$this->modulatehue'>
				<input type=hidden name=gaussian value='$this->gaussian'>
				<input type=hidden name=gaussiansigma value='$this->gaussiansigma'>
				<input type=hidden name=sharpen value='$this->sharpen'>
				<input type=hidden name=sharpensigma value='$this->sharpensigma'>
				<input type=hidden name=monochrome value='$this->monochrome'>
				<input type=hidden name=normalize value='$this->normalize'>
				<input type=hidden name=negate value='$this->negate'>
				<input type=hidden name=spread value='$this->spread'>
				<input type=hidden name=median value='$this->median'>
				When this image is filtered correctly, click: <input type='submit' name='submit' value='commit' class='buttonstyle'> (will change the image permanently).
			</form>
		</td>
	</tr>
</table>


%%listrow%%
 



%%nullobject%%
<img src='/bicons/warning.png' alt='Warning' align=absmiddle> Sorry, that image is not available for editing. 



%%footer%%




%%postprocess%%




%%end of context%%
