Wikipedia:WikiProject Chemistry/Structure drawing workgroup/Mysid's script: Difference between revisions
Content deleted Content added
Fix positioning code |
Note on bug. |
||
Line 104:
#read the file one pixel row at a time, always starting at the edge value
#detected, going outwards until we hit a completely empty line (pure
#transparent pixels)
#BUG:This works for most BKchem files, but is broken by text with gaps at the
#edge. Maybe a nice fat gaussian blur will fix this and make an automatic
#border...
for ($y=$maxy; $y<$he; $y++) {
@row = $img->GetPixels(width=>$wi, height=>1, x=>1, y=>$y, map=>'RGBA');
Line 175 ⟶ 177:
#well. There is a group which encompasses all the tags, so put it there.
if (!$firstgroupflag && /<g/) {
#Only do it once!
$firstgroupflag = 1 ;
|