{"id":20811532,"url":"https://github.com/nextbreakpoint/freeimage4java","last_synced_at":"2025-05-07T09:47:11.146Z","repository":{"id":82319820,"uuid":"63818883","full_name":"nextbreakpoint/freeimage4java","owner":"nextbreakpoint","description":"FreeImage4Java provides a Java wrapper of FreeImage library","archived":false,"fork":false,"pushed_at":"2024-07-16T17:33:10.000Z","size":294,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T08:51:15.423Z","etag":null,"topics":["freeimage","freeimage-wrapper","java","java-library","java-wrapper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextbreakpoint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-20T22:26:08.000Z","updated_at":"2024-08-20T03:52:28.000Z","dependencies_parsed_at":"2024-11-17T20:44:55.612Z","dependency_job_id":"5ea85ed0-f7ce-4c4d-8637-e5d73d22f518","html_url":"https://github.com/nextbreakpoint/freeimage4java","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextbreakpoint%2Ffreeimage4java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextbreakpoint%2Ffreeimage4java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextbreakpoint%2Ffreeimage4java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextbreakpoint%2Ffreeimage4java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextbreakpoint","download_url":"https://codeload.github.com/nextbreakpoint/freeimage4java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252854337,"owners_count":21814669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["freeimage","freeimage-wrapper","java","java-library","java-wrapper"],"created_at":"2024-11-17T20:44:21.801Z","updated_at":"2025-05-07T09:47:11.140Z","avatar_url":"https://github.com/nextbreakpoint.png","language":"Java","readme":"# FreeImage4Java 3.18.0-2.2\n\nFreeImage4Java provides a Java wrapper of FreeImage library version 3.18.0.\n\nPlease note that starting from version 3.18.0-2.0 the wrapper requires Java 22 and the Java FFM API (which is still in preview).\nOlder versions of the wrapper still work with Java 11 or later, but they use JNI with same version of FreeImage.\n\n\n## License\n\nFreeImage4Java is distributed under the terms of BSD 3-Clause License.\n\n    Copyright (c) 2016-2024, Andrea Medeghini\n    All rights reserved.\n\n    Redistribution and use in source and binary forms, with or without\n    modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice, this\n        list of conditions and the following disclaimer.\n\n    * Redistributions in binary form must reproduce the above copyright notice,\n        this list of conditions and the following disclaimer in the documentation\n        and/or other materials provided with the distribution.\n\n    * Neither the name of FreeImage4Java nor the names of its\n        contributors may be used to endorse or promote products derived from\n        this software without specific prior written permission.\n\n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n## Notice\n\nFreeImage4Java is distributed as independent JAR files, one for each supported operating system. \nEach JAR file contains a native library which must be installed in the library path of the Java runtime.\n\nPlease note that the native library is statically liked with FreeImage library under the terms of FreeImage Public License, version 1.0.\nYou should have received a copy of the FIPL v1.0 license with FreeImage4Java. See http://freeimage.sourceforge.net for more information about FreeImage.\n\n\n## Get binaries\n\nFreeImage4Java is available in Maven Central Repository and [GitHub](https://github.com/nextbreakpoint/freeimage4Java).\n\nIf you are using Maven, add one of the following dependencies in your POM:\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.nextbreakpoint\u003c/groupId\u003e\n        \u003cartifactId\u003ecom.nextbreakpoint.freeimage4Java.macos\u003c/artifactId\u003e\n        \u003cversion\u003e3.18.0-2.2\u003c/version\u003e\n    \u003c/dependency\u003e\n    \n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.nextbreakpoint\u003c/groupId\u003e\n        \u003cartifactId\u003ecom.nextbreakpoint.freeimage4Java.linux\u003c/artifactId\u003e\n        \u003cversion\u003e3.18.0-2.2\u003c/version\u003e\n    \u003c/dependency\u003e\n    \n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.nextbreakpoint\u003c/groupId\u003e\n        \u003cartifactId\u003ecom.nextbreakpoint.freeimage4Java.windows\u003c/artifactId\u003e\n        \u003cversion\u003e3.18.0-2.2\u003c/version\u003e\n    \u003c/dependency\u003e\n\nAlso, add one of the following to download the native library:\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n        \u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cid\u003ecopy-lib\u003c/id\u003e\n                \u003cphase\u003epackage\u003c/phase\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eunpack\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cartifactItems\u003e\n                        \u003cartifactItem\u003e\n                            \u003cgroupId\u003ecom.nextbreakpoint\u003c/groupId\u003e\n                            \u003cartifactId\u003ecom.nextbreakpoint.freeimage4java.macos\u003c/artifactId\u003e\n                            \u003cclassifier\u003ex86_64\u003c/classifier\u003e\n                            \u003ctype\u003ejar\u003c/type\u003e\n                            \u003coverWrite\u003etrue\u003c/overWrite\u003e\n                            \u003coutputDirectory\u003e${project.build.directory}/lib\u003c/outputDirectory\u003e\n                        \u003c/artifactItem\u003e\n                    \u003c/artifactItems\u003e\n                    \u003cincludes\u003e**/*.dylib\u003c/includes\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n    \u003c/plugin\u003e\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n        \u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cid\u003ecopy-lib\u003c/id\u003e\n                \u003cphase\u003epackage\u003c/phase\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eunpack\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cartifactItems\u003e\n                        \u003cartifactItem\u003e\n                            \u003cgroupId\u003ecom.nextbreakpoint\u003c/groupId\u003e\n                            \u003cartifactId\u003ecom.nextbreakpoint.freeimage4java.linux\u003c/artifactId\u003e\n                            \u003cclassifier\u003ex86_64\u003c/classifier\u003e\n                            \u003ctype\u003ejar\u003c/type\u003e\n                            \u003coverWrite\u003etrue\u003c/overWrite\u003e\n                            \u003coutputDirectory\u003e${project.build.directory}/lib\u003c/outputDirectory\u003e\n                        \u003c/artifactItem\u003e\n                    \u003c/artifactItems\u003e\n                    \u003cincludes\u003e**/*.so\u003c/includes\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n    \u003c/plugin\u003e\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n        \u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cid\u003ecopy-lib\u003c/id\u003e\n                \u003cphase\u003epackage\u003c/phase\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eunpack\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cartifactItems\u003e\n                        \u003cartifactItem\u003e\n                            \u003cgroupId\u003ecom.nextbreakpoint\u003c/groupId\u003e\n                            \u003cartifactId\u003ecom.nextbreakpoint.freeimage4java.windows\u003c/artifactId\u003e\n                            \u003cclassifier\u003ex86_64\u003c/classifier\u003e\n                            \u003ctype\u003ejar\u003c/type\u003e\n                            \u003coverWrite\u003etrue\u003c/overWrite\u003e\n                            \u003coutputDirectory\u003e${project.build.directory}/lib\u003c/outputDirectory\u003e\n                        \u003c/artifactItem\u003e\n                    \u003c/artifactItems\u003e\n                    \u003cincludes\u003e**/*.dll\u003c/includes\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n    \u003c/plugin\u003e\n\n\n## Build libraries\n\nWe recommend to use a Mac to build FreeImage4Java because you can compile the library for all systems in one place, but that is not strictly required.\nA Linux system can be used to compile the library for Linux and Windows (via cross compilation), and use a Mac system only to compile the library for MacOS.\n\nWe assume you have a Mac, however the same build instructions work for Linux (but only for compiling the library for Linux and Windows).\n\nMake sue you have installed Xcode command line tools (only for MacOS), Docker, git, make, maven, and Java 22.\n\n    We use Docker to simplify the toolchain configuration and ensure to have a consistent environment\n\n### Build library for MacOS\n\nCompile and install the library:\n\n    make -C freeimage4Java-macos/native build-lib install\n\nThe library will be installed in the resources directory of the module:\n\n    freeimage4Java-macos/src/main/resources/libfreeimage4Java.dylib\n\nInspect the symbols exported by the library:\n\n    nm -gU freeimage4Java-macos/src/main/resources/libfreeimage4Java.dylib\n\nInspect the libraries linked with the library:\n\n    otool -L freeimage4Java-macos/src/main/resources/libfreeimage4Java.dylib\n\n### Build library for Linux\n\nCompile and install the library:\n\n    make -C freeimage4Java-linux/native build-lib install\n\nThe library will be installed in the resources directory of the module:\n\n    freeimage4Java-linux/src/main/resources/libfreeimage4Java.so\n\nInspect the symbols exported by the library:\n\n    objdump -t freeimage4Java-linux/src/main/resources/libfreeimage4Java.so\n\nInspect the libraries linked with the library:\n\n    objdump -p freeimage4Java-linux/src/main/resources/libfreeimage4Java.so | grep .so\n\n### Build library for Windows\n\nCompile and install the library:\n\n    make -C freeimage4Java-windows/native build-lib install\n\nThe library will be installed in the resources directory of the module:\n\n    freeimage4Java-windows/src/main/resources/freeimage4Java.dll\n\nInspect the symbols exported by the library:\n\n    objdump -t freeimage4Java-windows/src/main/resources/freeimage4Java.dll\n\nInspect the libraries linked with the library:\n\n    objdump -p freeimage4Java-windows/src/main/resources/freeimage4Java.dll | grep .dll\n\n## Build Java code\n\nCompile and package the JARs:\n\n    make clean package\n\nThe artifacts will be created in the target directory of each module:\n\n    freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2.jar\n    freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2-x86_64.jar\n    \n    freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2.jar\n    freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2-x86_64.jar\n    \n    freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2.jar\n    freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2-x86_64.jar\n\nList the content of the JAR files:\n\n    unzip -t freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2.jar\n    unzip -t freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2-x86_64.jar\n\n    unzip -t freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2.jar\n    unzip -t freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2-x86_64.jar\n\n    unzip -t freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2.jar\n    unzip -t freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2-x86_64.jar\n\nInstall the artifacts in your local Maven repository:\n\n    make install\n\n## Test Java code\n\nTest the MacOS module (must be executed on MacOS):\n\n    make verify system=macos\n\nTest the Linux module (must be executed on Linux):\n\n    make verify system=linux\n\nTest the Windows module (must be executed on Windows):\n\n    make verify system=windows\n\n## Generate Java code\n\nThe Java code of all modules is generated from the FreeImage header files by jextract.\n\nDownload and install jextract for Java 22 for all target systems (see links below).\n\nEdit the source file in the target module updating the path of jextract and java.\n\nGenerate the code for MacOS (must be executed on MacOS):\n\n    eval $(cat freeimage4Java-macos/source) \u0026\u0026 make extract system=macos\n\nGenerate the code for Linux (must be executed on Linux):\n\n    eval $(cat freeimage4Java-linux/source) \u0026\u0026 make extract system=linux\n\nGenerate the code for Windows (must be executed on Windows):\n\n    eval $(cat freeimage4Java-windows/source) \u0026\u0026 make extract system=windows\n\n\n## Code examples\n\nA simple example is provided in the module freeimage4Java-examples.\n\nSee the POM file for details about how to download the native library and execute the example:\n\n    freeimage4Java-examples/pom.xml\n\n\n## References\n\nJava Foreign Function and Memory API:\nhttps://openjdk.org/jeps/454\n\njextract download:\nhttps://jdk.java.net/jextract/\n\njextract guide:\nhttps://github.com/openjdk/jextract/blob/master/doc/GUIDE.md\n\nFreeImage documentation:\nhttps://freeimage.sourceforge.io/documentation.html\n\nFreeImage source code:\nhttps://sourceforge.net/p/freeimage/code/\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextbreakpoint%2Ffreeimage4java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextbreakpoint%2Ffreeimage4java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextbreakpoint%2Ffreeimage4java/lists"}