Resizing "large" images is slow and consumes a lot of memory

Description

This is true for Lucee 4.5, Lucee 5.2 and Adobe ColdFusion 10, 11, and 2016. There may not be a good way to improve this, but I'm putting this ticket in so it can at least be looked into.

Taking a JPG file that's around 18 Megs and resizing it to another size takes over 1 minute of processing and consumes 500 MB to 1 GB of RAM on the heap. By contrast the same resize operation using the ImageMagik CLI uses around 1GB of RAM but only runs for around 9 seconds. The java resize code spends a great deal of time doing getRGB calls. Probably once for every single Pixel in the image which would be millions of times.

Here is the only line of code needed to reproduce this:

Here is a URL to download the image file (too large to attach to this ticket)
https://drive.google.com/open?id=1spSr2qaPwdpXdzkfBH2XW7s8Kzbany1Z

Here's the ImageMagik call I tested with that took 9 seconds (requires you to install ImageMagik)

Environment

None

Assignee

Michael Offner

Reporter

Brad Wood

Priority

Critical

Fix versions

Sprint

None
Configure