Commit d650a2d5 authored by Claes Sjofors's avatar Claes Sjofors

Bugfix in conversion of png image to pdf and ps

parent dca006ac
...@@ -154,6 +154,7 @@ void cnv_image_pixel_iter( cnv_tImImage image, ...@@ -154,6 +154,7 @@ void cnv_image_pixel_iter( cnv_tImImage image,
int rgb_width; int rgb_width;
int rowstride; int rowstride;
int n_channels; int n_channels;
unsigned char null_rgb[4] = {0,0,0,0};
rgb = gdk_pixbuf_get_pixels( (GdkPixbuf *)image); rgb = gdk_pixbuf_get_pixels( (GdkPixbuf *)image);
rgb_height = gdk_pixbuf_get_height( (GdkPixbuf *)image); rgb_height = gdk_pixbuf_get_height( (GdkPixbuf *)image);
...@@ -165,8 +166,12 @@ void cnv_image_pixel_iter( cnv_tImImage image, ...@@ -165,8 +166,12 @@ void cnv_image_pixel_iter( cnv_tImImage image,
for ( int j = 0; j < rgb_height; j++) { for ( int j = 0; j < rgb_height; j++) {
rgb = rgb_row; rgb = rgb_row;
for ( int i = 0; i < rgb_width; i++) { for ( int i = 0; i < rgb_width; i++) {
if ( n_channels >= 4 && *(rgb+3)) if ( n_channels >= 4) {
if ( *(rgb+3))
(pixel_cb) ( userdata, fp, rgb); (pixel_cb) ( userdata, fp, rgb);
else
(pixel_cb) ( userdata, fp, null_rgb);
}
else if ( n_channels == 3) else if ( n_channels == 3)
(pixel_cb) ( userdata, fp, rgb); (pixel_cb) ( userdata, fp, rgb);
rgb += n_channels; rgb += n_channels;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment