golang wrapper for openjpeg library v2.5.0
only tested on windows x64 (Windows 7 Windows 10) Mac OS X 13 centos 7 ubuntu 22.04. you should test it yourself for other platforms.
refer to example dir
import openjpeg "github.com/linxlib/openjpeg"install golang > 1.18 first
- install MSYS2
- add
C:\msys64\mingw64\bintoPATHenvironment - open
MSYS2 MSYSfrom start menu, install gcc withpacman -S mingw-w64-x86_64-gcc git clone https://github.com/linxlib/openjpegcd openjpeg\examplego run -v .\main.go- then you get a
jp2000.jpgin the same dir. you can change the example code to get different image file
The version of openjpeg in package manager may not the latest (v2.5.0), so we need to build from source.
- install gcc cmake ...etc
wget https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.0.zipunzip v2.5.0.zip && cd openjpeg-2.5.0/mkdir build && cd buildcmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:bool=onmakemake install- you will find openjpeg(libopenjp2) library and in
/usr/local/lib/usr/local/include...
git clone https://github.com/linxlib/openjpegcd openjpeg\examplego run main.go- then you get a
jp2000.jpgin the same dir. you can change the example code to get different image file
May be you don't need to install openjpeg just like linux.
- configure cgo compile environment by yourself
- if you have installed ffmpeg, so openjpeg 2.5.0 already installed, just skip the next step
brew install openjpegand make sureopj_decompress -hcan get something likeopenjp2 library v2.5.0git clone https://github.com/linxlib/openjpegcd openjpeg/examplego run main.go- then you get a
jp2000.jpgin the same dir. you can change the example code to get different image file
- cross compile (compile executable file in only one platform (may be docker))
- add some other platforms support