-
Notifications
You must be signed in to change notification settings - Fork 1
/
print_landscape.html
43 lines (41 loc) · 1.25 KB
/
print_landscape.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% if (defined($height)) {
<a href="<% $url %>"><img src="<% $url %>" title="<% $title %>" alt="<% $title %>" height="<% $height %>" width="<% $width %>"></a>
% }
%# } else {
%#<a href="<% $url %"><img src="<% $url %>" title="<% $title %>" alt="<% $title %>"></a>
%# }
<%init>
my $pic = new PRFGraph(config=>$config, accession => $accession);
my $filename = $pic->Picture_Filename(type => 'landscape',);
my $picture_status = 1;
my $url;
$species = 'virus' if ($species =~ /virus/);
$picture_status = 1;
if (!-r $filename) {
$picture_status = $pic->Make_Landscape($species);
$height = $picture_status->{height};
$width = $picture_status->{width};
}
if (!defined($picture_status)) {
$url = undef;
} else {
MyDeps::Res(('Image::Size')) unless (eval "use Image::Size; 1");
($width, $height) = imgsize($filename);
$url = $pic->Picture_Filename(type => 'landscape',url=>'url');
}
if (!defined($width) or $width == 0) {
$width = undef;
$height = undef;
} else {
my $factor = 1200 / $width;
$width = 1200;
$height = sprintf("%.0f",$height * $factor, 1);
}
my $title = "MFE landscape for $accession from $species";
</%init>
<%args>
$accession => "SGDID:S0004310"
$species => "saccharomyces_cerevisiae"
$height => "200"
$width => "800"
</%args>