Skip to content

Commit 4a780b2

Browse files
Merge pull request #7 from nextbreakpoint/dev/3.18.0-2.2
change package name. rename examples and tests modules
2 parents 4683363 + b69b554 commit 4a780b2

File tree

183 files changed

+524
-1097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+524
-1097
lines changed

.gitignore

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@
66
/freeimage4java-windows/src/main/resources/freeimage4java.dll
77
/freeimage4java-linux/src/main/resources/libfreeimage4java.so
88
/freeimage4java-macos/src/main/resources/libfreeimage4java.dylib
9-
/freeimage4java-macos-test/test0.png
10-
/freeimage4java-macos-test/test1.png
11-
/freeimage4java-macos-test/test2.png
12-
/freeimage4java-linux-test/test0.png
13-
/freeimage4java-linux-test/test1.png
14-
/freeimage4java-linux-test/test2.png
15-
/freeimage4java-windows-test/test0.png
16-
/freeimage4java-windows-test/test1.png
17-
/freeimage4java-windows-test/test2.png
18-
/freeimage4java-macos-examples/output.png
19-
/freeimage4java-linux-examples/output.png
20-
/freeimage4java-windows-examples/output.png
9+
/freeimage4java-examples/output.png
10+
/freeimage4java-tests/test0.png
11+
/freeimage4java-tests/test1.png
12+
/freeimage4java-tests/test2.png

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ dump:
3030
verify:
3131
test $(system)
3232
@echo System = $(system)
33-
#MAVEN_OPTS="--enable-preview --enable-native-access=ALL-UNNAMED -Djava.library.path=freeimage4java-$(system)-test/target/lib -Djextract.trace.downcalls=false -Xlog:library" mvn verify -P$(system);
34-
MAVEN_OPTS="--enable-preview --enable-native-access=ALL-UNNAMED -Djava.library.path=freeimage4java-$(system)-test/target/lib -Djextract.trace.downcalls=false $(properties)" mvn verify -P$(system);
33+
#MAVEN_OPTS="--enable-preview --enable-native-access=ALL-UNNAMED -Djava.library.path=freeimage4java-tests/target/lib -Djextract.trace.downcalls=false -Xlog:library" mvn verify -P$(system);
34+
MAVEN_OPTS="--enable-preview --enable-native-access=ALL-UNNAMED -Djava.library.path=freeimage4java-tests/target/lib -Djextract.trace.downcalls=false $(properties)" mvn verify -P$(system);
3535

3636
.PHONY: copy-legal
3737
copy-legal:

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# FreeImage4Java 3.18.0-2.1
1+
# FreeImage4Java 3.18.0-2.2
22

33
FreeImage4Java provides a Java wrapper of FreeImage library version 3.18.0.
44

5+
Please 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).
6+
Older versions of the wrapper still work with Java 11 or later, but they use JNI with same version of FreeImage.
7+
58

69
## License
710

@@ -54,19 +57,19 @@ If you are using Maven, add one of the following dependencies in your POM:
5457
<dependency>
5558
<groupId>com.nextbreakpoint</groupId>
5659
<artifactId>com.nextbreakpoint.freeimage4Java.macos</artifactId>
57-
<version>3.18.0-2.1</version>
60+
<version>3.18.0-2.2</version>
5861
</dependency>
5962

6063
<dependency>
6164
<groupId>com.nextbreakpoint</groupId>
6265
<artifactId>com.nextbreakpoint.freeimage4Java.linux</artifactId>
63-
<version>3.18.0-2.1</version>
66+
<version>3.18.0-2.2</version>
6467
</dependency>
6568

6669
<dependency>
6770
<groupId>com.nextbreakpoint</groupId>
6871
<artifactId>com.nextbreakpoint.freeimage4Java.windows</artifactId>
69-
<version>3.18.0-2.1</version>
72+
<version>3.18.0-2.2</version>
7073
</dependency>
7174

7275
Also, add one of the following to download the native library:
@@ -226,25 +229,25 @@ Compile and package the JARs:
226229

227230
The artifacts will be created in the target directory of each module:
228231

229-
freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.1.jar
230-
freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.1-x86_64.jar
232+
freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2.jar
233+
freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2-x86_64.jar
231234

232-
freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.1.jar
233-
freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.1-x86_64.jar
235+
freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2.jar
236+
freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2-x86_64.jar
234237

235-
freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.1.jar
236-
freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.1-x86_64.jar
238+
freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2.jar
239+
freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2-x86_64.jar
237240

238241
List the content of the JAR files:
239242

240-
unzip -t freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.1.jar
241-
unzip -t freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.1-x86_64.jar
243+
unzip -t freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2.jar
244+
unzip -t freeimage4Java-macos/target/com.nextbreakpoint.freeimage4Java.macos-3.18.0-2.2-x86_64.jar
242245

243-
unzip -t freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.1.jar
244-
unzip -t freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.1-x86_64.jar
246+
unzip -t freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2.jar
247+
unzip -t freeimage4Java-linux/target/com.nextbreakpoint.freeimage4Java.linux-3.18.0-2.2-x86_64.jar
245248

246-
unzip -t freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.1.jar
247-
unzip -t freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.1-x86_64.jar
249+
unzip -t freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2.jar
250+
unzip -t freeimage4Java-windows/target/com.nextbreakpoint.freeimage4Java.windows-3.18.0-2.2-x86_64.jar
248251

249252
Install the artifacts in your local Maven repository:
250253

@@ -287,15 +290,11 @@ Generate the code for Windows (must be executed on Windows):
287290

288291
## Code examples
289292

290-
A simple example is provided for each supported system.
291-
292-
See POM files for details about how to download the native library and execute the code:
293-
294-
freeimage4Java-macos-examples/pom.xml
293+
A simple example is provided in the module freeimage4Java-examples.
295294

296-
freeimage4Java-linux-examples/pom.xml
295+
See the POM file for details about how to download the native library and execute the example:
297296

298-
freeimage4Java-windows-examples/pom.xml
297+
freeimage4Java-examples/pom.xml
299298

300299

301300
## References

freeimage4java-examples/pom.xml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>com.nextbreakpoint</groupId>
6+
<artifactId>com.nextbreakpoint.freeimage4java</artifactId>
7+
<version>3.18.0-2.2</version>
8+
</parent>
9+
<artifactId>com.nextbreakpoint.freeimage4java.examples</artifactId>
10+
<packaging>jar</packaging>
11+
<name>FreeImage4Java Examples</name>
12+
<description>FreeImage4Java provides a Java wrapper of FreeImage library</description>
13+
<profiles>
14+
<profile>
15+
<id>macos</id>
16+
<dependencies>
17+
<dependency>
18+
<groupId>com.nextbreakpoint</groupId>
19+
<artifactId>com.nextbreakpoint.freeimage4java.macos</artifactId>
20+
<version>${project.version}</version>
21+
</dependency>
22+
</dependencies>
23+
<build>
24+
<plugins>
25+
<plugin>
26+
<groupId>org.apache.maven.plugins</groupId>
27+
<artifactId>maven-dependency-plugin</artifactId>
28+
<executions>
29+
<execution>
30+
<id>copy-lib</id>
31+
<phase>test-compile</phase>
32+
<goals>
33+
<goal>unpack</goal>
34+
</goals>
35+
<configuration>
36+
<artifactItems>
37+
<artifactItem>
38+
<groupId>com.nextbreakpoint</groupId>
39+
<artifactId>com.nextbreakpoint.freeimage4java.macos</artifactId>
40+
<classifier>x86_64</classifier>
41+
<type>jar</type>
42+
<overWrite>true</overWrite>
43+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
44+
</artifactItem>
45+
</artifactItems>
46+
<includes>**/*.dylib</includes>
47+
</configuration>
48+
</execution>
49+
</executions>
50+
</plugin>
51+
</plugins>
52+
</build>
53+
</profile>
54+
<profile>
55+
<id>linux</id>
56+
<dependencies>
57+
<dependency>
58+
<groupId>com.nextbreakpoint</groupId>
59+
<artifactId>com.nextbreakpoint.freeimage4java.linux</artifactId>
60+
<version>${project.version}</version>
61+
</dependency>
62+
</dependencies>
63+
<build>
64+
<plugins>
65+
<plugin>
66+
<groupId>org.apache.maven.plugins</groupId>
67+
<artifactId>maven-dependency-plugin</artifactId>
68+
<executions>
69+
<execution>
70+
<id>copy-lib</id>
71+
<phase>test-compile</phase>
72+
<goals>
73+
<goal>unpack</goal>
74+
</goals>
75+
<configuration>
76+
<artifactItems>
77+
<artifactItem>
78+
<groupId>com.nextbreakpoint</groupId>
79+
<artifactId>com.nextbreakpoint.freeimage4java.linux</artifactId>
80+
<classifier>x86_64</classifier>
81+
<type>jar</type>
82+
<overWrite>true</overWrite>
83+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
84+
</artifactItem>
85+
</artifactItems>
86+
<includes>**/*.so</includes>
87+
</configuration>
88+
</execution>
89+
</executions>
90+
</plugin>
91+
</plugins>
92+
</build>
93+
</profile>
94+
<profile>
95+
<id>windows</id>
96+
<dependencies>
97+
<dependency>
98+
<groupId>com.nextbreakpoint</groupId>
99+
<artifactId>com.nextbreakpoint.freeimage4java.windows</artifactId>
100+
<version>${project.version}</version>
101+
</dependency>
102+
</dependencies>
103+
<build>
104+
<plugins>
105+
<plugin>
106+
<groupId>org.apache.maven.plugins</groupId>
107+
<artifactId>maven-dependency-plugin</artifactId>
108+
<executions>
109+
<execution>
110+
<id>copy-lib</id>
111+
<phase>test-compile</phase>
112+
<goals>
113+
<goal>unpack</goal>
114+
</goals>
115+
<configuration>
116+
<artifactItems>
117+
<artifactItem>
118+
<groupId>com.nextbreakpoint</groupId>
119+
<artifactId>com.nextbreakpoint.freeimage4java.windows</artifactId>
120+
<classifier>x86_64</classifier>
121+
<type>jar</type>
122+
<overWrite>true</overWrite>
123+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
124+
</artifactItem>
125+
</artifactItems>
126+
<includes>**/*.dll</includes>
127+
</configuration>
128+
</execution>
129+
</executions>
130+
</plugin>
131+
</plugins>
132+
</build>
133+
</profile>
134+
</profiles>
135+
<build>
136+
<plugins>
137+
<plugin>
138+
<groupId>org.codehaus.mojo</groupId>
139+
<artifactId>exec-maven-plugin</artifactId>
140+
<executions>
141+
<execution>
142+
<id>run</id>
143+
<phase>test</phase>
144+
<goals>
145+
<goal>exec</goal>
146+
</goals>
147+
<configuration>
148+
<executable>java</executable>
149+
<arguments>
150+
<argument>--enable-preview</argument>
151+
<argument>--enable-native-access=ALL-UNNAMED</argument>
152+
<argument>-classpath</argument>
153+
<classpath/>
154+
<argument>-Djava.library.path=${project.build.directory}/lib</argument>
155+
<argument>com.nextbreakpoint.freeimage4java.ConvertImageMain</argument>
156+
<argument>sample.png</argument>
157+
<argument>output.png</argument>
158+
</arguments>
159+
</configuration>
160+
</execution>
161+
</executions>
162+
</plugin>
163+
</plugins>
164+
</build>
165+
</project>

freeimage4java-macos-examples/src/main/java/com/nextbreakpoint/freeimage4java/macos/ConvertImageMain.java renamed to freeimage4java-examples/src/main/java/com/nextbreakpoint/freeimage4java/ConvertImageMain.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
package com.nextbreakpoint.freeimage4java.macos;
1+
package com.nextbreakpoint.freeimage4java;
22

33
import java.lang.foreign.Arena;
44

5-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.FIF_PNG;
6-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.FreeImage_ConvertToGreyscale;
7-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.FreeImage_Initialise;
8-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.FreeImage_Load;
9-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.FreeImage_Save;
10-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.FreeImage_Unload;
11-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.PNG_DEFAULT;
12-
import static com.nextbreakpoint.freeimage4java.macos.Libfreeimage.TRUE;
5+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.FIF_PNG;
6+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.FreeImage_ConvertToGreyscale;
7+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.FreeImage_Initialise;
8+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.FreeImage_Load;
9+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.FreeImage_Save;
10+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.FreeImage_Unload;
11+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.PNG_DEFAULT;
12+
import static com.nextbreakpoint.freeimage4java.Libfreeimage.TRUE;
1313
import static java.lang.foreign.MemorySegment.NULL;
1414

1515
class ConvertImageMain {
@@ -23,8 +23,8 @@ public static void main(String[] args) {
2323

2424
System.out.println("Converting image...");
2525

26-
System.out.println(STR."Source file \{sourceFileName}");
27-
System.out.println(STR."Output file \{outputFileName}");
26+
System.out.printf("Source file %s%n", sourceFileName);
27+
System.out.printf("Output file %s%n", outputFileName);
2828

2929
try (var arena = Arena.ofConfined()) {
3030
var pSourceBitmap = NULL;

0 commit comments

Comments
 (0)