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

MaxImageWidth? and MaxImageHeight? set as metadata

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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}