Lines 67-72
sub new {
Link Here
|
67 |
$params->{mimetype} = 'image/png'; |
67 |
$params->{mimetype} = 'image/png'; |
68 |
$params->{imagefile} = $fullsize->png(); |
68 |
$params->{imagefile} = $fullsize->png(); |
69 |
$params->{thumbnail} = $thumbnail->png(); |
69 |
$params->{thumbnail} = $thumbnail->png(); |
|
|
70 |
# Convert the image to PNG and print it on standard output |
71 |
|
72 |
open my $fh1, '>', '/inlibro/BD/outputV.png'; |
73 |
print {$fh1} $params->{thumbnail}; |
74 |
close $fh1; |
70 |
} |
75 |
} |
71 |
|
76 |
|
72 |
return $class->SUPER::new($params); |
77 |
return $class->SUPER::new($params); |
Lines 94-103
sub _scale_image {
Link Here
|
94 |
; #'1' creates true color image... |
99 |
; #'1' creates true color image... |
95 |
$newimage->copyResampled( $image, 0, 0, 0, 0, $width_reduce, |
100 |
$newimage->copyResampled( $image, 0, 0, 0, 0, $width_reduce, |
96 |
$height_reduce, $width, $height ); |
101 |
$height_reduce, $width, $height ); |
|
|
102 |
my $background = $newimage->colorAllocate(0,0,0); |
103 |
$newimage->transparent($background); |
97 |
return $newimage; |
104 |
return $newimage; |
98 |
} |
105 |
} |
99 |
else { |
106 |
else { |
100 |
return $image; |
107 |
my $newimage = GD::Image->new( $width, $height, 1 ); |
|
|
108 |
; #'1' creates true color image... |
109 |
$newimage->copyResampled( $image, 0, 0, 0, 0, $width, |
110 |
$height, $width, $height ); |
111 |
my $background = $newimage->colorAllocate(0,0,0); |
112 |
$newimage->transparent($background); |
113 |
return $newimage; |
101 |
} |
114 |
} |
102 |
} |
115 |
} |
103 |
|
116 |
|