Changeset 19054

Show
Ignore:
Timestamp:
19.04.2009 19:31:40 (11 years ago)
Author:
davidb
Message:

MaxImageWidth? and MaxImageHeight? set as metadata

Location:
gsdl/trunk/perllib/plugins
Files:
2 modified

Legend:

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

    r19025 r19054  
    159159    return 0 if ($filename_no_path eq "" || !-f $filename_full_path); 
    160160 
    161     if ($self->{'cache_generated_images'}) { 
     161    if ($self->{'enable_cache'}) { 
    162162    $self->init_cache_for_file($filename_full_path); 
    163163    } 
     
    224224    $doc_obj->add_metadata ($section, "ImageHeight", $image_height); 
    225225    $doc_obj->add_metadata ($section, "ImageSize",   $image_size); 
     226 
     227    if ((defined $self->{'MaxImageWidth'})  
     228    && ($image_width > $self->{'MaxImageWidth'})) { 
     229    $self->{'MaxImageWidth'} = $image_width; 
     230    } 
     231    if ((defined $self->{'MaxImageHeight'}) 
     232    && ($image_height > $self->{'MaxImageHeight'})) { 
     233    $self->{'MaxImageHeight'} = $image_height; 
     234    } 
     235 
    226236 
    227237    $doc_obj->add_metadata ($section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/$assocfilemeta/[Image]\">"); 
     
    335345    # Determine the full name and path of the output file 
    336346    my $target_file_path; 
    337     if ($self->{'cache_generated_images'}) { 
     347    if ($self->{'enable_cache'}) { 
    338348    my $cached_image_dir = $self->{'cached_dir'}; 
    339349    my $image_root = $self->{'cached_file_root'}; 
  • gsdl/trunk/perllib/plugins/PagedImagePlugin.pm

    r18468 r19054  
    282282    print STDERR "<Processing n='$file' p='PagedImagePlugin'>\n" if ($gli); 
    283283     
     284    $self->{'MaxImageWidth'} = 0; 
     285    $self->{'MaxImageHeight'} = 0; 
    284286     
    285287    # here we need to decide if we have an old text .item file, or a new xml  
     
    496498     
    497499    # add numpages metadata 
    498     $doc_obj->set_utf8_metadata_element ($doc_obj->get_top_section(), 'NumPages', $self->{'num_pages'}); 
    499  
     500    my $topsection = $doc_obj->get_top_section(); 
     501 
     502    $doc_obj->set_utf8_metadata_element ($topsection, 'NumPages', $self->{'num_pages'}); 
     503 
     504    $doc_obj->set_utf8_metadata_element($topsection,"MaxImageWidth",$self->{'MaxImageWidth'}); 
     505    $doc_obj->set_utf8_metadata_element($topsection,"MaxImageHeight",$self->{'MaxImageHeight'}); 
     506    $self->{'MaxImageWidth'} = undef; 
     507    $self->{'MaxImageHeight'} = undef; 
    500508     
    501509} 
     
    584592    # add numpages metadata 
    585593    $doc_obj->set_utf8_metadata_element ($topsection, 'NumPages', "$num"); 
     594 
     595    $doc_obj->set_utf8_metadata_element($topsection,"MaxImageWidth",$self->{'MaxImageWidth'}); 
     596    $doc_obj->set_utf8_metadata_element($topsection,"MaxImageHeight",$self->{'MaxImageHeight'}); 
     597    $self->{'MaxImageWidth'} = undef; 
     598    $self->{'MaxImageHeight'} = undef; 
     599 
     600 
    586601    return $doc_obj; 
    587602}