Changeset 11249


Ignore:
Timestamp:
2006-02-14T16:54:53+13:00 (18 years ago)
Author:
kjdon
Message:

added some checks that the image and text files exist before we try to convert/read them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/PagedImgPlug.pm

    r11090 r11249  
    263263    $rotate = 0 unless defined $rotate;
    264264   
     265    # check that the image file exists!!
     266    if (!-f $filename) {
     267    print "PagedImgPlug: ERROR: File $filename does not exist, skipping\n";
     268    return 0;
     269    }
     270
    265271    my $top=0;
    266272    if ($section eq $doc_obj->get_top_section()) {
     
    887893    my $self = shift (@_);
    888894    my ($fullpath, $file, $doc_obj, $cursection) = @_;
     895   
     896    # check that the text file exists!!
     897    if (!-f $fullpath) {
     898    print "PagedImgPlug: ERROR: File $fullpath does not exist, skipping\n";
     899    return 0;
     900    }
    889901
    890902    # Do encoding stuff
Note: See TracChangeset for help on using the changeset viewer.