View | Details | Raw Unified | Return to bug 8088
Collapse All | Expand All

(-)a/Koha/CoverImage.pm (-2 / +5 lines)
Lines 75-80 sub new { Link Here
75
sub _scale_image {
75
sub _scale_image {
76
    my ( $self, $image, $maxwidth, $maxheight ) = @_;
76
    my ( $self, $image, $maxwidth, $maxheight ) = @_;
77
    my ( $width, $height ) = $image->getBounds();
77
    my ( $width, $height ) = $image->getBounds();
78
	$image->alphaBlending(0);
79
	$image->saveAlpha(1);
78
    if ( $width > $maxwidth || $height > $maxheight ) {
80
    if ( $width > $maxwidth || $height > $maxheight ) {
79
81
80
        my $percent_reduce;  # Percent we will reduce the image dimensions by...
82
        my $percent_reduce;  # Percent we will reduce the image dimensions by...
Lines 92-99 sub _scale_image { Link Here
92
        my $height_reduce = sprintf( "%.0f", ( $height * $percent_reduce ) );
94
        my $height_reduce = sprintf( "%.0f", ( $height * $percent_reduce ) );
93
        my $newimage = GD::Image->new( $width_reduce, $height_reduce, 1 )
95
        my $newimage = GD::Image->new( $width_reduce, $height_reduce, 1 )
94
          ;        #'1' creates true color image...
96
          ;        #'1' creates true color image...
95
        $newimage->copyResampled( $image, 0, 0, 0, 0, $width_reduce,
97
        $newimage->alphaBlending(0);
96
            $height_reduce, $width, $height );
98
        $newimage->saveAlpha(1);
99
        $newimage->copyResampled( $image, 0, 0, 0, 0, $width_reduce, $height_reduce, $width, $height );
97
        return $newimage;
100
        return $newimage;
98
    }
101
    }
99
    else {
102
    else {
(-)a/tools/upload-cover-image.pl (-1 / +2 lines)
Lines 102-107 if ( $op eq 'cud-process' && $fileID ) { Link Here
102
    my $upload = Koha::UploadedFiles->find( $fileID );
102
    my $upload = Koha::UploadedFiles->find( $fileID );
103
    if ( $filetype eq 'image' ) {
103
    if ( $filetype eq 'image' ) {
104
        my $fh       = $upload->file_handle;
104
        my $fh       = $upload->file_handle;
105
        GD::Image->trueColor(1);
105
        my $srcimage = GD::Image->new($fh);
106
        my $srcimage = GD::Image->new($fh);
106
        $fh->close if $fh;
107
        $fh->close if $fh;
107
        if ( defined $srcimage ) {
108
        if ( defined $srcimage ) {
Lines 190-195 if ( $op eq 'cud-process' && $fileID ) { Link Here
190
                            my $full_filename = Cwd::abs_path("$dir/$filename"); #Resolve any relative filepath references
191
                            my $full_filename = Cwd::abs_path("$dir/$filename"); #Resolve any relative filepath references
191
                            my $srcimage;
192
                            my $srcimage;
192
                            if ( $full_filename =~ /^\Q$dir\E/ ){
193
                            if ( $full_filename =~ /^\Q$dir\E/ ){
194
                                GD::Image->trueColor(1);
193
                                $srcimage = GD::Image->new($full_filename);
195
                                $srcimage = GD::Image->new($full_filename);
194
                            }
196
                            }
195
                            my $biblio;
197
                            my $biblio;
196
- 

Return to bug 8088