Browse files

Really invoke build-transparency-map when a tRNS chunk is present.

tRNS method sets (TRANSPARENCY *PNG-STATE*) to some raw data
representation depending on colour-type. Then it adds
so (TRANSPARENCY *PNG-STATE*) will become a 2D-array
before *png-state* is finished.

The latter part (adding the postprocessor) was inside an incorrect
WHEN form, requiring (COLOUR-TYPE *PNG-STATE*) to be 0 or 2. First,
our COLOUR-TYPE is a keyword, not a byte (thus 0 and 2 correspond to
:greyscale and :truecolor, respectively). Second,
build-transparency-map is prepared to handle :indexed-colour images as
well, and there are images where it's useful. Third, preceding ECASE
will fail for any colour-type except :greyscale, :truecolor and
:indexed-colour.

Therefore it seems that no additional checks are needed here at all,
and that's the assumption behind this patch.
  • Loading branch information...
1 parent 837393f commit e3d258ba6450ba673c74dcf186402933e4e76652 @akovalenko committed Jan 18, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 ancillary-chunks.lisp
View
4 ancillary-chunks.lisp
@@ -50,9 +50,7 @@
(big-endian-vector-to-integer (subseq chunk-data 4 6)))))
(:indexed-colour (setf (transparency *png-state*)
chunk-data)))
- (when (or (eql (colour-type *png-state*) 0)
- (eql (colour-type *png-state*) 2))
- (push #'build-transparency-map (postprocess-ancillaries *png-state*))))
+ (push #'build-transparency-map (postprocess-ancillaries *png-state*)))
(defmethod parse-ancillary-chunk ((chunk-type (eql '|gAMA|)) chunk-data)
(setf (gamma *png-state*)

0 comments on commit e3d258b

Please sign in to comment.