ImageScaleToFit Bug

I just ran into an interesting imageScaleToFit bug. I was writing some code to handle scaling an uploaded image when I got this error:

For gray scale images the interpolation argument must be one of: NEAREST | BILINEAR | BICUBIC | HIGHESTQUALITY | HIGHQUALITY | MEDIUMQUALITY | HIGHESTPERFORMANCE | HIGHPERFORMANCE | MEDIUMPERFORMANCE

According to the docs, the default interpolation is highestQuality so I don’t quite get what CF is thinking I’m using. Specifying the interpolation made the error go away of course and then works just fine for grayscale or non-grayscale images. (I filed a bug report for this already.)

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments