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

(-)a/Koha/CoverImage.pm (-1 / +14 lines)
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
(-)a/tools/upload-cover-image.pl (-1 / +1 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 ) {
108
- 

Return to bug 8088