$MAXW=6400;$MAXH=6400;$MAXS=4920000;if(!isset($maxsz))$maxsz=500;
function is_image($fn)
{if(!strcasecmp($fn,".bmp"))return true;if(!strcasecmp($fn,".jpg"))return true;
if(!strcasecmp($fn,".jpeg"))return true;if(!strcasecmp($fn,".gif"))return true;
if(!strcasecmp($fn,".bmp"))return true;if(!strcasecmp($fn,".png"))return true;
if(!strcasecmp($fn,".wmf"))return true;return false;
}
function is_bmp_image($fn){if(!strcasecmp($fn,".wmf"))return true;return false;}
function prompt($m){echo("
".$m."
");}
?>
MetaPixel Raster to Vector, DXF, Gcode Converter
>
$fdtrue=0;unset($loaded);
if(isset($sample))
{echo("This is a sample. Click New to upload other files.");
include("sample.htm");
$iext=".gif";
$fname="tmp/".uniqid("");
@copy(getcwd()."/sample.gif",getcwd()."/".$fname.".gif");
$fdtrue=1;
}else
if(isset($metapath))
{$iext=strtolower(strrchr($metapath,'.'));
//$fname="tmp/".uniqid("");
$fname="tmp/".basename(substr($metapath,0,strlen($metapath)-4));
$r=$_SERVER['HTTP_REFERER'];
if(!strstr($r,"/cgibin/meta/vector/")&&!strstr($r,"/cgibin/stvg/"))
{echo("Unauthorized Access - try the sample
");@copy(getcwd()."/sample.gif",getcwd()."/".$fname.".gif");}
else @copy(getcwd()."/".$metapath,getcwd()."/".$fname.$iext);
$fdtrue=1;
}else
if(($iext=strtolower(strrchr($upfile_name,'.')))&&is_image($iext))
{$fname=explode(".",$upfile_name);$fname="tmp/".urlencode($fname[0]);
//if(file_exists("tmp/".$fname.$iext))$fname="tmp/".uniqid("");
if(!@copy($upfile,$fname.$iext))
{if($fdcontents=@file_get_contents($upfile_name))
{if($fd=fopen($fname.$iext,"wb"))
{fwrite($fd,$fdcontents);fclose($fd);$fdtrue=1;
}else echo("upload failed: ".$upfile_name."
\ncouldn't write: ".$fname.$iext."
");
}else echo("upload failed:: ".$upfile_name.":".$fname.$iext."
");
}else $fdtrue=1;
}
else {prompt("error: that's not a image file
:$upfile_name:");exit(1);}
if($fdtrue) // just uploaded, set stat vars for original
{//if(is_bmp_image($iext))
{$tfname=$fname.".bmp"; // if !.gif||!.jpg||!.bmp then convert to bmp
//system(getcwd()."/../img/convert \"".getcwd()."/".$fname.$iext."\" ".getcwd()."/".$tfname);
@system(getcwd()."/../mkbmp \"".getcwd()."/".$fname.$iext."\" ".$maxsz,$ss);
$oext=$iext;$iext=".bmp";
@include(getcwd()."/".$fname."-.php");
}$loaded=true;
}
?>
MetaPixel Raster to Vector Converter
if(isset($loaded)):?>
?>
Error:=$ss;?> the server was momentarily too busy
or the image exceeded the server's capacity
Send Email if the problem persists.
hit REFRESH to try again
if(!isset($corner_always_threshold))$corner_always_threshold=60;
if(!isset($corner_surround))$corner_surround=4;
if(!isset($corner_threshold))$corner_threshold=100;
if(!isset($despeckle_level))$despeckle_level=0;
if(!isset($despeckle_tightness))$despeckle_tightness=2.0;
if(!isset($dpi))$dpi=600;
if(!isset($error_threshold))$error_threshold=3.0;
if(!isset($filter_iterations))$filter_iterations=4;
if(!isset($line_reversion_threshold))$line_reversion_threshold=.01;
if(!isset($line_threshold))$line_threshold=1;
if(!isset($output_format))$output_format="svg";
if(!isset($tangent_surround))$tangent_surround=3;
//if(!isset($width_weight_factor))$width_weight_factor=0;
if(!isset($output_format2))$output_format2="-s";
?>
$rdc=0;$oh=$height;$ow=$width;
$dims=" ".$width."x".$height."";
if($width>$maxsz){$height=intval($height*$maxsz/$width);$width=$maxsz;$rdc=1;}
if($height>$maxsz){$width=intval($width*$maxsz/$height);$height=$maxsz;$rdc=1;}
if($rdc)$dims.=" (reduced)";
?>
Raster Preview =$dims;?>
if(!isset($metapath)){?>
download full size GIF or BMP format ???
if($ow>4000||$oh>4000)
{?>
the full size dimensions exceed 4000 pixels
which may be larger than some browsers will display
}?>
}?>