Changeset 24601 for main/trunk/greenstone2/perllib/giget.pm
- Timestamp:
- 2011-09-15T18:28:42+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/giget.pm
r24600 r24601 152 152 } 153 153 else { 154 my $command = "\"".&util::get_perl_exec()."\" -S gs-magick.pl identify \"$output_fname\" 2>&1"; 155 my $result = `$command`; 156 157 my $status = $?; 154 158 # need to shift the $? exit code returned by system() by 8 bits and 155 159 # then convert it to a signed value to work out whether it is indeed > 0 156 my $status = system("\"".&util::get_perl_exec()."\" -S gs-magick.pl identify \"$output_fname\""); 157 $status >>= 8; 158 $status = (($status & 0x80) ? -(0x100 - ($status & 0xFF)) : $status); 159 160 if($status > 0 ) { 160 #$status >>= 8; 161 #$status = (($status & 0x80) ? -(0x100 - ($status & 0xFF)) : $status); 162 #if($status > 0 ) { 163 if($status != 0 ) { 161 164 print STDERR "**** NOT JPEG: output_fname \n"; 162 165 unlink $output_fname; 163 166 } 164 167 else { 165 my $command = "\"".&util::get_perl_exec()."\" -S gs-magick.pl identify \"$output_fname\" 2>&1";166 my $result = `$command`;167 168 168 169 my $type = 'unknown';
Note:
See TracChangeset
for help on using the changeset viewer.