Skip to content

Commit

Permalink
Removed unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Suriya-Murugan committed Dec 19, 2023
1 parent f4b6f5f commit 3c59ae0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion Java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dependencies {
implementation 'com.syncfusion:syncfusion-javahelper:+'
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-tiff', version: '3.7.0'
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-jpeg', version: '3.7.0'
implementation group: 'org.apache.commons', name: 'commons-imaging', version: '1.0'
compile 'com.google.code.gson:gson:2.8.6'
testImplementation 'org.apache.httpcomponents:httpclient'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
Expand Down
30 changes: 15 additions & 15 deletions Java/src/main/java/ej2/webservices/WordEditorController.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,24 @@ public void remove(MetafileImageParsedEventHandler delegate) throws Exception {
// Converts Metafile to raster image.
private static void onMetafileImageParsed(Object sender, MetafileImageParsedEventArgs args) throws Exception {
if(args.getIsMetafile()) {
// You can write your own method definition for converting Metafile to raster image using any third-party image converter.
args.setImageStream(convertMetafileToRasterImage(args.getMetafileStream()));
// You can write your own method definition for converting Metafile to raster image using any third-party image converter.
args.setImageStream(convertMetafileToRasterImage(args.getMetafileStream()));
}else {
InputStream inputStream = StreamSupport.toStream(args.getMetafileStream());
// Use ByteArrayOutputStream to collect data into a byte array
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
InputStream inputStream = StreamSupport.toStream(args.getMetafileStream());
// Use ByteArrayOutputStream to collect data into a byte array
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

// Read data from the InputStream and write it to the ByteArrayOutputStream
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
byteArrayOutputStream.write(buffer, 0, bytesRead);
}
// Read data from the InputStream and write it to the ByteArrayOutputStream
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
byteArrayOutputStream.write(buffer, 0, bytesRead);
}

// Convert the ByteArrayOutputStream to a byte array
byte[] tiffData = byteArrayOutputStream.toByteArray();
// Read TIFF image from byte array
ByteArrayInputStream tiffInputStream = new ByteArrayInputStream(tiffData);
// Convert the ByteArrayOutputStream to a byte array
byte[] tiffData = byteArrayOutputStream.toByteArray();
// Read TIFF image from byte array
ByteArrayInputStream tiffInputStream = new ByteArrayInputStream(tiffData);
IIORegistry.getDefaultInstance().registerServiceProvider(new TIFFImageReaderSpi());

// Create ImageReader and ImageWriter instances
Expand Down

0 comments on commit 3c59ae0

Please sign in to comment.