Giter Club home page Giter Club logo

openjpeg's Introduction

openjpeg GitHub tag (latest by date)

golang wrapper for openjpeg library v2.5.0

description

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.

usage

refer to example dir

import openjpeg "github.com/linxlib/openjpeg"

build

install golang > 1.18 first

Windows

  • install MSYS2
  • add C:\msys64\mingw64\bin to PATH environment
  • open MSYS2 MSYS from start menu, install gcc with pacman -S mingw-w64-x86_64-gcc
  • git clone https://github.com/linxlib/openjpeg
  • cd openjpeg\example
  • go run -v .\main.go
  • then you get a jp2000.jpg in the same dir. you can change the example code to get different image file

Linux (Centos 7)

The version of openjpeg in package manager may not the latest (v2.5.0), so we need to build from source.

build and install openjpeg 2.5.0 (optional)

  • install gcc cmake ...etc
  • wget https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.0.zip
  • unzip v2.5.0.zip && cd openjpeg-2.5.0/
  • mkdir build && cd build
  • cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:bool=on
  • make
  • make install
  • you will find openjpeg(libopenjp2) library and in /usr/local/lib /usr/local/include ...

run

  • git clone https://github.com/linxlib/openjpeg
  • cd openjpeg\example
  • go run main.go
  • then you get a jp2000.jpg in the same dir. you can change the example code to get different image file

Mac OS X

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 openjpeg and make sure opj_decompress -h can get something like openjp2 library v2.5.0
  • git clone https://github.com/linxlib/openjpeg
  • cd openjpeg/example
  • go run main.go
  • then you get a jp2000.jpg in the same dir. you can change the example code to get different image file

TODO

  • cross compile (compile executable file in only one platform (may be docker))
  • add some other platforms support

openjpeg's People

Stargazers

 avatar

Watchers

 avatar

Forkers

fiyzou

openjpeg's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.