Closed SkyeHoefling closed 2 years ago
While researching #3 I discovered that we must compile FileOnQ.Imaging.Heif.Encoders
in debug mode due to libjpeg-turbo
compilation issues. When we solve this problem, we should be able to compile FileOnQ.Imaging.Heif.Encoders
in release mode.
Per research in https://github.com/FileOnQ/Imaging.Heif/issues/37#issuecomment-1005958923 we can submit a PR for this as we can compile libjpeg-turbo
in release mode now
Description
The build process compiles libjpeg-turbo in debug mode instead of release mode. This generates a file that is roughly 600kb larger than if it was built in release mode. It is a best practice to try and compile upstream libraries in release mode as the code is optimized.
During the initial proof of concept the JPEG encoder that users libjpeg-turbo was failing to save. We were seeing errors when writing to disk. After investigation it was determined that we are going to have to use debug mode for now and try and fix this later
Sample Code
The snippet below is from the original proof of concept and will change in the future
The
libjpeg-turbo
code fails onLibEncoder.encode(encoder, handle, outputImage, "output.jpeg")
when the library is built under release mode but works when the library is built under debug modeDifficulty: [Hard]