%%image-resize-editor-html%%
progmin : / (context #151)
2002-06-05 15:50:38

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

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

if ($postvars['newwidth']=="") $this->newwidth= $this->width;
else $this->newwidth= $postvars['newwidth'];
if ($postvars['newheight']=="") $this->newheight= $this->height;
else $this->newheight= $postvars['newheight'];
if ($postvars['quality']=="") $this->quality= 75;
else $this->quality= $postvars['quality'];
$tags.= "&width=$this->newwidth&height=$this->newheight&quality=$this->quality";

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

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

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


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

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


// 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.gif' 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.gif' 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=resize$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>Resize Options</td>
			</tr>
		</table>	
	</td>
</tr>
<tr>
	<td align='right' valign='top'>new width:</td>
	<td valign='top'><input type='text' name='newwidth' size='4' maxlength='255' value="$this->newwidth"> pixels</td>
</tr>
<tr>
	<td align='right' valign='top'>new height:</td>
	<td valign='top'><input type='text' name='newheight' size='4' maxlength='255' value="$this->newheight"> pixels</td>
</tr>
<tr>
	<td align='right' valign='top'>resize type:</td>
	<td valign='top'>
		<input type="radio" name="exact" value="0" $this->exact0>proportional (fit within width x height)<br>
		<input type="radio" name="exact" value="1" $this->exact1>exact (make exactly width x height)
	</td>
</tr>
<tr>
	<td colspan=2 align='center'>
		<p>&nbsp</p>
		<table class='infoBar'>
			<tr>
				<td>Compression Options</td>
			</tr>
		</table>	
	</td>
</tr>
<tr valign='top'>
	<td align='right'>compression level:</td>
	<td><table>
		<tr>
			<td align=left valign=top width=1%><input type='text' name='quality' size='3' maxlength='3' value="$this->quality"></td>
			<td align=left width=99%>100: highest quality, larger filesize <br>
				&nbsp;75: standard quality<br>
				&nbsp;&nbsp;1: lowest quality,smaller filesize
				</td>
		</tr>
	</table></td>
</tr>
<tr>
	<td colspan=2 align='center'>
		<p>&nbsp</p>
		<table class='infoBar'>
			<tr>
				<td>Rotate Options</td>
			</tr>
		</table>	
	</td>
</tr>
<tr>
	<td align='right' valign='top'>rotate:</td>
	<td valign='top'><input type="radio" name="rotate" value="0" $this->rotate0>0&deg; | <input type="radio" name="rotate" value="90" $this->rotate90>90&deg; | <input type="radio" name="rotate" value="180" $this->rotate180>180&deg; | <input type="radio" name="rotate" value="270" $this->rotate270>270&deg;</td>
</tr>
<tr>
	<td align='right' valign='top'>mirror:</td>
	<td valign='top'><input type=hidden name=flop value=0><input type="checkbox" name="flop" value="1" $this->flop1> (flops image left-&gt;right)</td>
</tr>
<tr> 
	<td width=30%>&nbsp;</td>
	<td width=70%><input type='submit' name='submit' value='resize' class='buttonstyle'></td>
</tr>
</table>
</form>
<table border=0>
	<tr>
		<td width='1%'><img src='/bicons/spacer.gif' 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>resize</tt>. To permanently resize the image, 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=width value='$this->newwidth'>
				<input type=hidden name=height value='$this->newheight'>
				<input type=hidden name=exact value='$this->exact'>
				<input type=hidden name=quality value='$this->quality'>
				<input type=hidden name=rotate value='$this->rotate'>
				<input type=hidden name=flop value='$this->flop'>
				When this image is sized correctly, click: <input type='submit' name='submit' value='commit' class='buttonstyle'> (will resize 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%%
