$MAXW=1600;$MAXH=1200;$MAXS=1920000;
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."
");}
?>
MetaEtch CNC PCB Milling Engraving Raster to Vector to Toolpath DXF to Gcode Converter
include(getenv("DOCUMENT_ROOT")."/header.htm");?>
$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()."/sample2.gif",getcwd()."/".$fname.".gif");
$fdtrue=1;
}else
if(($iext=strtolower(strrchr($upfile_name,'.')))&&is_image($iext))
{$fname=explode(".",$upfile_name);$fname="tmp/".urlencode($fname[0]);
//if(file_exists($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="o_".uniqid("").".bmp";$iext=".bmp"; // if !.gif||!.jpg||!.bmp then convert to bmp
system(getcwd()."/../img/convert \"".getcwd()."/tmp/".$ufname."\" ".getcwd()."/tmp/".$tfname);
}$loaded=true;$aspect=1;
}
?>
MetaEtch Image to Vector to Toolpath Converter
for cnc machine art, cnc router, engraver, sign cutter, plasma torch, laser, etc...
$expiretime=time()-1800;$path='tmp/';
if($handle=opendir($path))
{while(false!==($file=readdir($handle)))
if(is_file($path.$file)&&filemtime($path.$file)<$expiretime&&$file!="index.html")unlink($path.$file);
closedir($handle);
}
?>
include(getenv("DOCUMENT_ROOT")."/footer.htm");?>