Changeset 17483

Show
Ignore:
Timestamp:
06.10.2008 15:10:31 (11 years ago)
Author:
kjdon
Message:

I just discovered that if image magick was not installed, you weren't getting the image saved as an associated file. So now it is, and can be viewed using srcicon and srclink

Files:
1 modified

Legend:

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

    r17250 r17483  
    119119        &gsprintf(STDERR, "<Warning p='ImagePlugin' r='{ImageConverter.noconversionavailable}: {ImageConverter.".$self->{'no_image_conversion_reason'}."}'>"); 
    120120    } 
     121    # all we do is add the original image as an associated file, and set up srclink etc 
     122    my $assoc_file = $doc_obj->get_assocfile_from_sourcefile(); 
     123    my $section = $doc_obj->get_top_section(); 
     124 
     125    $doc_obj->associate_file($filename_full_path, $assoc_file, "", $section); 
     126 
     127    $doc_obj->add_metadata ($section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">"); 
     128    $doc_obj->add_metadata ($section, "/srclink", "</a>"); 
     129    $doc_obj->add_metadata ($section, "srcicon", "<img src=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\" width=\"100\">"); 
     130 
    121131    } 
    122132    #we have no text - adds dummy text and NoText metadata