GNOME Bugzilla – Bug 744120
Cannot view JPEG images with GRAYSCALE colorspace in XPS documents
Last modified: 2015-06-04 12:12:30 UTC
I'm using evince 3.14.1-1 and libgxps 0.2.2-3+b2 from Debian jessie. When I view the attached documents in evince, I don't get the images displayed. Other images from the same batch of scans do have their images displayed though.
The tarball was too big to attach to the bug so I uploaded it here: http://bonedaddy.net/pabs3/files/tmp/evince-xps-no-display-images.tar
The problem is that GRAYSCALE colorspace is not implemented when loading jpeg files. You can see it by compiling with --enable-debug and running the test program with GXPS_DEBUG, see: $ GXPS_DEBUG=1 ./test-gxps KonMin\ 200dpi\ fine.xps GXPS-Message: save GXPS-Message: transform (1,000000, 0,000000, 0,000000, 1,000000) [0,000000, 0,000000] GXPS-Message: set_fill_pattern (image) GXPS-Message: Unsupported jpeg color space GRAYSCALE GXPS-Message: Unsupported jpeg color space GRAYSCALE GXPS-Message: move_to (0,000000, 0,000000) GXPS-Message: line_to (793,440000, 0,000000) GXPS-Message: line_to (793,440000, 1122,240000) GXPS-Message: line_to (0,000000, 1122,240000) GXPS-Message: close_path GXPS-Message: restore
I've just pushed a patch to add support for GREYSCALE color space jpeg images, but those images are still not correctly rendered. I mean, the image surfaces are correctly rendered, but we are not painting the surfaces correctly inside the page for the documents you provided. For some reason they are unscaled, I guess we are not correctly computing viewport and/or viewbox. This needs some more investigation.
Found the issue, we were indeed not applying the right scale for ImageBrush elements. I've just fixed it in git master, it was indeed unrelated to this issue, so I'm closing it now.