Subject: | Suggestion: limit size of displayed image.. |
High-resolution photo files can be displayed by browsers out of
proportion to the window. That is, displayed thousands of pixels wide
and high - with scroll bars. This is usually not what was intended.
There's probably a better fix, but the following adds a max_width
parameter to new(). Images larger than max_width will be scaled by the
browser. If max_width is not specified, no scaling is done (same a
current behavior.)
Note that ideally, save picture should provide the full resolution.
In single_index, at line 461 (of 0.07) add the following few lines;
if( defined $self->param( 'max_width' ) ) {
my $max_width = $self->param( 'max_width' );
if( $width > $max_width ) {
my $scale = $max_width / $width;
$width = int($width * $scale);
$height = int($height * $scale);
}
}