The other I was scrolling through Snort and I saved a meme to later share it with friends but the format of the image was avifand I wanted to convert it to jpeg but I couldn't do that using morphos because I deferred adding avif support because I knew it would be difficult and the low hanging fruit was adding support for other formats. To put it simple, this PR adds support for the AVIF format and adds the ability to go back and forth with that format.
The biggest challenge was dealing with third-party dependencies like go-avif and libheif which both depend on external C libraries, resulting in changing the Dockerfile to install such external C libraries. The problem was that Debian package manager didn't provide the latest version of libheif library and was behind by 5 minor versions (as of the time of submitting this change latest version is 1.17.3 and on Debian bookworm the newest version available is 1.15.1), so I went ahead and switch to the Alpine image flavor as base image. Other than that, it's pretty much the same as adding support for other formats.
Type of change
Please delete options that are not relevant.
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
First off, a change to the Ci pipeline was made as well, installing external dependencies to the test workflow, to make sure that the program compiles successfully. Second off, I added a new test case to the image package. And finally, I QA'd this change extensively, either running the server in bare metal and running it in a container.
To test it out:
Locally
$ brew install cmake make pkg-config x265 libde265 libjpeg libtool aom
$ brew install libheif
$ make run
On a container (make sure docker is installed)
$ make docker-build
$ make docker-run
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] I have checked my code and corrected any misspellings
Avif support
Description
The other I was scrolling through Snort and I saved a meme to later share it with friends but the format of the image was
avif
and I wanted to convert it to jpeg but I couldn't do that usingmorphos
because I deferred addingavif
support because I knew it would be difficult and the low hanging fruit was adding support for other formats. To put it simple, this PR adds support for theAVIF
format and adds the ability to go back and forth with that format.The biggest challenge was dealing with third-party dependencies like go-avif and libheif which both depend on external C libraries, resulting in changing the
Dockerfile
to install such external C libraries. The problem was that Debian package manager didn't provide the latest version oflibheif
library and was behind by 5 minor versions (as of the time of submitting this change latest version is 1.17.3 and on Debian bookworm the newest version available is 1.15.1), so I went ahead and switch to the Alpine image flavor as base image. Other than that, it's pretty much the same as adding support for other formats.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
First off, a change to the Ci pipeline was made as well, installing external dependencies to the
test
workflow, to make sure that the program compiles successfully. Second off, I added a new test case to theimage
package. And finally, I QA'd this change extensively, either running the server in bare metal and running it in a container.To test it out:
Checklist: