davidbyttow / govips

A lightning fast image processing and resizing library for Go
MIT License
1.28k stars 199 forks source link

Fix bug with icc transform bit depth #323

Closed AttilaTheFun closed 1 year ago

AttilaTheFun commented 1 year ago

This PR fixes a bug with the TransformICCProfile API. Here I was passing 0 for the bit depth (leaving it unset) but the default value if you do this is 8-bit. This causes ICC transforms of >8-bit images to revert to 8-bit and become distorted. The code I'm adding here was copied from the adjacent OptimizeICCProfile method which defaults to 16-bit processing unless the source image was already 8-bit.

AttilaTheFun commented 1 year ago

@tonimelisma This one is a pretty straightforward bug fix 😅

coveralls commented 1 year ago

Coverage Status

Coverage increased (+0.04%) to 76.945% when pulling 27080f03bdcd5d1349092e4272ff1b0ccea91cc5 on AttilaTheFun:lshire-fix-transform-icc-profile-bug into 7881bfaa40a11b43354805cd4ddda7e7acc1ecf3 on davidbyttow:master.