Skip to content

Gfx::doImage: skip drawing image when it has singular matrix

otherwise it will result in broken output in Cairo backend.

Splash backend already works fine for this case because it checks for singular matrix in Splash::drawImage().

This commit adds that check early on in Gfx::doImage() which fixes the Cairo backend and for Splash backend means a perf improvement by avoiding lot of color computation and image preparation done in SplashOutputDev::draw{Image,ImageMask,MaskedImage,softMaskedImage} functions prior to calling Splash::drawImage which is the one that checks singular matrix and skips.

Note: singular matrix case is not mentioned in PDF spec but Xpdf and other pdf readers de-facto do as in here i.e. skip drawing an image when it has a singular (non invertible) matrix.

Fixes issue #1114 (closed)

Edited by Nelson Benítez León

Merge request reports