Changeset 2447


Ignore:
Timestamp:
2001-05-18T14:53:07+12:00 (23 years ago)
Author:
jrm21
Message:

Safety check: postscript files start with %! - don't just rely on .ps
extension.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/gsConvert.pl

    r2248 r2447  
    538538    if ($error ne "")
    539539    {
    540     print STDERR "PSPLUG: WARNING: Error executing gs: $error\n";
     540    print STDERR "PSPlug: WARNING: Error executing gs: $error\n";
    541541    &util::rm("$output_filestem.text") if (-e "$output_filestem.text");
    542542    &util::rm("$output_filestem.err") if (-e "$output_filestem.err");
     
    560560    close IN;
    561561
     562    # Make sure this is a ps file...
     563    if ($text !~ /^%!/) {
     564        print STDERR "Bad postscript header: not %!\n";
     565        return 0;
     566    }
     567
    562568    # if ps has Page data, then use it to delete all stuff before it.
    563569    $text =~ s/^.*?%%Page:.*?\n//s; # treat string as single line
Note: See TracChangeset for help on using the changeset viewer.