Changeset 10561 in josm for trunk


Ignore:
Timestamp:
2016-07-18T13:40:49+02:00 (8 years ago)
Author:
stoecker
Message:

see #13158 - add some sanity checks to geticons script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geticons.pl

    r10514 r10561  
    159159  {
    160160    $ifile =~ s/^images\///;
     161    # svg comes after png due to the glob, so only check for svg's
     162    if($ifile =~ /^(.*)\.svg$/)
     163    {
     164      if($haveicons{"$1.png"})
     165      {
     166        print STDERR "File $1 exists twice as .svg and .png.\n";
     167      }
     168      # check for unwanted svg effects
     169      if(open FILE, "<","images/$ifile")
     170      {
     171        undef $/;
     172        my $f = <FILE>;
     173        close FILE;
     174        while($f =~ /style\s*=\s*["']([^"']+)["']/g)
     175        {
     176          for my $x (split(/\s*;\s*/, $1))
     177          {
     178            print STDERR "Style starts with minus for $ifile: $x\n" if $x =~ /^-/;
     179          }
     180        }
     181        if($f =~ /viewBox\s*=\s*["']([^"']+)["']/)
     182        {
     183          my $x = $1;
     184          print STDERR "ViewBox has float values for $ifile: $x\n" if $x =~ /\./;
     185        }
     186      }
     187      else
     188      {
     189        print STDERR "Could not open file $ifile: $1";
     190      }
     191    }
    161192    $haveicons{$ifile} = 1;
    162193  }
Note: See TracChangeset for help on using the changeset viewer.