[Clipart] transparent turkeys

Jonadab the Unsightly One jonadab at bright.net
Fri Jan 7 04:33:15 PST 2005


"Stephen Silver" <ocalocal at btinternet.com> writes:

> So the problem is much more widespread than I expected.  But the fix
> can probably be automated: replace every "fill-opacity:0.75000000;"
> by "fill-opacity:1;" when it occurs on the same line as "fill:url".
> This should make the image look the same as Inkscape 0.39 shows it.
> I intend to try this out later.

Off the top of my head...

perl -e ' 
   fix("openclipart-0.09");
sub fix {
  my ($dir) = @_;
  for $f (<$dir/*>) {
    if (-d $f) { fix($f);
    } elsif ($f =~ /svg$/i) {
       open SVG, "<", $f; open TMP, ">", "temp"; my $line=0;
       while (<SVG>)     {
          ++$line;
          if (/fill:url/) {
             s/fill-opacity:0.75000000;/fill-opacity:1;/g
             print "$f line $line\n";
          }
          print TMP $_;  }
       close SVG; close TMP;
       `mv temp $f`;
    }}}
'

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/




More information about the clipart mailing list