Skip to content

Commit a42ec6d

Browse files
author
Evgeniy Sidenko
committed
Port and publish Aspose.Imaging for Java 25.4
1 parent 5da5d2d commit a42ec6d

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

Examples/pom.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.aspose</groupId>
55
<artifactId>imaging-java-examples</artifactId>
6-
<version>25.3</version>
6+
<version>25.4</version>
77
<packaging>jar</packaging>
88
<properties>
99
<maven.compiler.source>1.8</maven.compiler.source>
@@ -15,15 +15,13 @@
1515
<dependency>
1616
<groupId>com.aspose</groupId>
1717
<artifactId>aspose-imaging</artifactId>
18-
<version>25.3</version>
19-
<type>jar</type>
18+
<version>25.4</version>
2019
</dependency>
2120
<dependency>
2221
<groupId>com.aspose</groupId>
2322
<artifactId>aspose-imaging</artifactId>
24-
<version>25.3</version>
23+
<version>25.4</version>
2524
<classifier>javadoc</classifier>
26-
<type>jar</type>
2725
</dependency>
2826
</dependencies>
2927

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.aspose.imaging.examples.ModifyingImages;
2+
3+
import com.aspose.imaging.Image;
4+
import com.aspose.imaging.RasterImage;
5+
import com.aspose.imaging.examples.Logger;
6+
import com.aspose.imaging.examples.Utils;
7+
8+
public class AutoAdjustImageBrightness
9+
{
10+
public static void main(String[] args)
11+
{
12+
Logger.startExample();
13+
// The path to the documents' directory.
14+
String dataDir = Utils.getSharedDataDir() + "Png/";
15+
16+
String outputFilePath = Utils.getOutDir() + "result.png";
17+
String outputFilePath2 = Utils.getOutDir() + "result2.png";
18+
// Load an existing JPG image
19+
try (RasterImage image = (RasterImage) Image.load(dataDir + "sample.png"))
20+
{
21+
image.normalizeHistogram();
22+
image.save(outputFilePath);
23+
image.adjustContrast(30);
24+
image.save(outputFilePath2);
25+
}
26+
27+
Utils.deleteFile(outputFilePath);
28+
Utils.deleteFile(outputFilePath2);
29+
30+
Logger.endExample();
31+
}
32+
}

Examples/src/main/java/com/aspose/imaging/examples/RunExamples.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
116116
//// =====================================================
117117

118118
Logger.println("Running modifying and converting images tests:");
119+
AutoAdjustImageBrightness.main(args);
119120
UnifyUsageOfCommonOperations.main(args);
120121
LoadAvif.main(args);
121122
SupportDicomYBR422.main(args);

Examples/src/main/java/com/aspose/imaging/examples/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public final class Utils {
1010

1111
public static String getSharedDataDir() {
1212
File dir = new File(System.getProperty("user.dir"));
13-
dir = new File(dir, "src/main/resources");
13+
dir = new File(dir, "Examples/src/main/resources");
1414

1515
return dir.toString() + File.separator;
1616
}
630 KB
Loading

0 commit comments

Comments
 (0)