Ignore:
Timestamp:
2011-09-15T18:28:42+12:00 (13 years ago)
Author:
ak19
Message:

Dr Bainbridge suggested corrections to commits of revision 24600: 1. gs-magick.pl: close call on Pipe only if successfully opened. 2. Command_status always needs to be shifted and turned into its signed value for display in convertutil.pm. 3. giget calls to imagemagick more eficient: doesn't call identify twice, but just once since the exit code and output to STDOUT can both be inspected after just one call. Moreover, exit code needed to be tested for equality against 0, not whether it is greater than 0, so no shifting and converting to signed value required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/gs-magick.pl

    r24600 r24601  
    128128    #my $result = `$magick_cmd`; # This way will trap STDOUT into local variable
    129129
     130    my $result = "";
    130131    if (!open(PIN, "$magick_cmd |")) {
    131132    print STDERR "*** Can't run $magick_cmd. Error was: $!";
     133    } else {
     134    while (defined (my $imagick_output_line = <PIN>)) {
     135        $result = $result.$imagick_output_line;
     136    }
     137    close(PIN);
    132138    }
    133     my $result = "";
    134     while (defined (my $imagick_output_line = <PIN>)) {
    135     $result = $result.$imagick_output_line;
    136     }
    137     close(PIN);
    138139   
    139140    # Perl Special Variables http://www.kichwa.com/quik_ref/spec_variables.html
Note: See TracChangeset for help on using the changeset viewer.