Changeset 24346

Show
Ignore:
Timestamp:
29.07.2011 13:11:40 (8 years ago)
Author:
davidb
Message:

With added support for orthogonal indexes (i.e. audioDB index in addition to a text-based one like mg) the Image Magick warning appears for each orthogonal index. This change limits it to print it out just once

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/ImageConverter.pm

    r24225 r24346  
    3737    @ImageConverter::ISA = ('BaseMediaConverter'); 
    3838} 
     39 
     40# When used with multiple builder+buildproc, plugins loaded multiple times 
     41# => use this 'our' var to ensure only see the warning about ImageMagick once 
     42our $given_image_conversion_warning = 0; 
    3943 
    4044my $arguments = [ 
     
    139143 
    140144    if ($self->{'image_conversion_available'} == 0) { 
    141     my $outhandle = $self->{'outhandle'}; 
    142     &gsprintf($outhandle, "ImageConverter: {ImageConverter.noconversionavailable} ({ImageConverter.".$self->{'no_image_conversion_reason'}."})\n"); 
     145    if (!$given_image_conversion_warning) { 
     146        my $outhandle = $self->{'outhandle'}; 
     147        &gsprintf($outhandle, "ImageConverter: {ImageConverter.noconversionavailable} ({ImageConverter.".$self->{'no_image_conversion_reason'}."})\n"); 
     148        $given_image_conversion_warning = 1; 
     149    } 
    143150    } 
    144151