-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from idrsolutions/develop
JDEL-519 #comment move JDeli ImageIO plugin to github
- Loading branch information
Showing
32 changed files
with
1,733 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# JDeli_ImageIO_Plugin | ||
A plugin to replace ImageIO with JDeli. | ||
# JDeli ImageIO Plugin | ||
|
||
--- | ||
|
||
This is a plugin to extend ImageIO with JDeli. You will require JDeli to use this plugin, if you don't already have JDeli, you can download the trial [here](https://www.idrsolutions.com/jdeli/). | ||
|
||
|
||
#Installation | ||
|
||
--- | ||
|
||
This can be done by copying the repository, or the build jar to your class path. | ||
|
||
|
||
#Who do I talk to? | ||
|
||
--- | ||
|
||
Found a bug, or have a suggestion / improvement? Let us know through the Issues page. | ||
|
||
Got questions? You can contact us [here](https://idrsolutions.atlassian.net/servicedesk/customer/portal/8). | ||
|
||
--- | ||
|
||
|
||
Copyright 2021 IDRsolutions | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>groupId</groupId> | ||
<artifactId>JDeli_ImageIO_Plugin</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.idrsolutions</groupId> | ||
<artifactId>jdeli</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>3.0.0-M1</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.2.0</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.2.1</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<minimizeJar>true</minimizeJar> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 1997-2021 IDRsolutions (https://www.idrsolutions.com) | ||
*/ | ||
package com.idrsolutions; | ||
|
||
import com.idrsolutions.image.ImageFormat; | ||
import com.idrsolutions.image.utility.ImageTypeFinder; | ||
|
||
import javax.imageio.ImageReader; | ||
import javax.imageio.stream.ImageInputStream; | ||
import java.io.IOException; | ||
import java.util.Locale; | ||
|
||
public class BMPImageReaderSpi extends JDeliImageReaderSpi { | ||
|
||
private static final String[] names = {"BMP"}; | ||
private static final String[] suffixes = {"bmp"}; | ||
private static final String[] MIMETypes = {"image/bmp"}; | ||
|
||
public BMPImageReaderSpi() { | ||
|
||
super(names, suffixes, MIMETypes); | ||
} | ||
|
||
@Override | ||
public String getDescription(final Locale locale) { | ||
return "BMP JDeli Image Reader"; | ||
} | ||
|
||
@Override | ||
public boolean canDecodeInput(final Object source) throws IOException { | ||
|
||
final ImageInputStream input = (ImageInputStream) source; | ||
final byte[] b = new byte[140]; | ||
input.read(b); | ||
|
||
return ImageTypeFinder.getImageType(b).equals(ImageFormat.BMP_IMAGE); | ||
|
||
} | ||
|
||
@Override | ||
public ImageReader createReaderInstance() throws IOException { | ||
return createReaderInstance("bmp"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 1997-2021 IDRsolutions (https://www.idrsolutions.com) | ||
*/ | ||
package com.idrsolutions; | ||
|
||
import com.idrsolutions.image.encoder.OutputFormat; | ||
import java.io.IOException; | ||
import java.util.Locale; | ||
import javax.imageio.ImageTypeSpecifier; | ||
import javax.imageio.ImageWriter; | ||
|
||
public class BMPImageWriterSpi extends JDeliImageWriterSpi { | ||
|
||
private static final String[] names = {"Bitmap Graphics"}; | ||
private static final String[] suffixes = {"bmp"}; | ||
private static final String[] MIMETypes = {"image/bmp"}; | ||
|
||
public BMPImageWriterSpi() { | ||
super(names, suffixes, MIMETypes); | ||
} | ||
|
||
@Override | ||
public boolean canEncodeImage(final ImageTypeSpecifier imageType) { | ||
final int bands = imageType.getNumBands(); | ||
return bands == 1 || bands == 2 || bands == 3 || bands == 4; | ||
} | ||
|
||
@Override | ||
public String getDescription(final Locale locale) { | ||
return "BMP Image Writer"; | ||
} | ||
|
||
@Override | ||
public String[] getFormatNames() { | ||
return suffixes; | ||
} | ||
|
||
@Override | ||
public ImageWriter createWriterInstance(final Object extension) throws IOException { | ||
return super.createWriterInstance(OutputFormat.BMP); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.idrsolutions; | ||
|
||
import com.idrsolutions.image.ImageFormat; | ||
import com.idrsolutions.image.utility.ImageTypeFinder; | ||
|
||
import javax.imageio.ImageReader; | ||
import javax.imageio.stream.ImageInputStream; | ||
import java.io.IOException; | ||
import java.util.Locale; | ||
|
||
public class DICOMImageReaderSpi extends JDeliImageReaderSpi { | ||
|
||
private static final String[] names = {"DICOM"}; | ||
private static final String[] suffixes = {"dcm"}; | ||
private static final String[] MIMETypes = {"image/dicom"}; | ||
|
||
public DICOMImageReaderSpi() { | ||
|
||
super(names, suffixes, MIMETypes); | ||
} | ||
|
||
@Override | ||
public String getDescription(final Locale locale) { | ||
return "DICOM JDeli Image Reader"; | ||
} | ||
|
||
@Override | ||
public boolean canDecodeInput(final Object source) throws IOException { | ||
|
||
final ImageInputStream input = (ImageInputStream) source; | ||
final byte[] b = new byte[140]; | ||
input.read(b); | ||
|
||
return ImageTypeFinder.getImageType(b).equals(ImageFormat.DICOM_IMAGE); | ||
|
||
} | ||
|
||
@Override | ||
public ImageReader createReaderInstance() throws IOException { | ||
return createReaderInstance("dcm"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.idrsolutions; | ||
|
||
import com.idrsolutions.image.ImageFormat; | ||
import com.idrsolutions.image.utility.ImageTypeFinder; | ||
|
||
import javax.imageio.ImageReader; | ||
import javax.imageio.stream.ImageInputStream; | ||
import java.io.IOException; | ||
import java.util.Locale; | ||
|
||
public class EMFImageReaderSpi extends JDeliImageReaderSpi { | ||
|
||
private static final String[] names = {"EMF"}; | ||
private static final String[] suffixes = {"emf"}; | ||
private static final String[] MIMETypes = {"image/emf"}; | ||
|
||
public EMFImageReaderSpi() { | ||
|
||
super(names, suffixes, MIMETypes); | ||
} | ||
|
||
@Override | ||
public String getDescription(final Locale locale) { | ||
return "EMF JDeli Image Reader"; | ||
} | ||
|
||
@Override | ||
public boolean canDecodeInput(final Object source) throws IOException { | ||
|
||
final ImageInputStream input = (ImageInputStream) source; | ||
final byte[] b = new byte[140]; | ||
input.read(b); | ||
|
||
return ImageTypeFinder.getImageType(b).equals(ImageFormat.EMF_IMAGE); | ||
|
||
} | ||
|
||
@Override | ||
public ImageReader createReaderInstance() throws IOException { | ||
return createReaderInstance("emf"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.idrsolutions; | ||
|
||
import com.idrsolutions.image.ImageFormat; | ||
import com.idrsolutions.image.utility.ImageTypeFinder; | ||
|
||
import javax.imageio.ImageReader; | ||
import javax.imageio.stream.ImageInputStream; | ||
import java.io.IOException; | ||
import java.util.Locale; | ||
|
||
public class GIFImageReaderSpi extends JDeliImageReaderSpi { | ||
|
||
private static final String[] names = {"GIF"}; | ||
private static final String[] suffixes = {"gif"}; | ||
private static final String[] MIMETypes = {"image/gif"}; | ||
|
||
public GIFImageReaderSpi() { | ||
|
||
super(names, suffixes, MIMETypes); | ||
} | ||
|
||
@Override | ||
public String getDescription(final Locale locale) { | ||
return "GIF JDeli Image Reader"; | ||
} | ||
|
||
@Override | ||
public boolean canDecodeInput(final Object source) throws IOException { | ||
|
||
final ImageInputStream input = (ImageInputStream) source; | ||
final byte[] b = new byte[140]; | ||
input.read(b); | ||
|
||
return ImageTypeFinder.getImageType(b).equals(ImageFormat.GIF_IMAGE); | ||
|
||
} | ||
|
||
@Override | ||
public ImageReader createReaderInstance() throws IOException { | ||
return createReaderInstance("gif"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 1997-2021 IDRsolutions (https://www.idrsolutions.com) | ||
*/ | ||
package com.idrsolutions; | ||
|
||
import com.idrsolutions.image.ImageFormat; | ||
import com.idrsolutions.image.utility.ImageTypeFinder; | ||
|
||
import java.io.IOException; | ||
import java.util.Locale; | ||
import javax.imageio.ImageReader; | ||
import javax.imageio.stream.ImageInputStream; | ||
|
||
public class HEICImageReaderSpi extends JDeliImageReaderSpi { | ||
|
||
private static final String[] names = {"HEIC"}; | ||
private static final String[] suffixes = {"heic", "heif"}; | ||
private static final String[] MIMETypes = {"image/heic"}; | ||
|
||
public HEICImageReaderSpi() { | ||
|
||
super(names, suffixes, MIMETypes); | ||
} | ||
|
||
@Override | ||
public String getDescription(final Locale locale) { | ||
return "HEIC JDeli Image Reader"; | ||
} | ||
|
||
@Override | ||
public boolean canDecodeInput(final Object source) throws IOException { | ||
|
||
final ImageInputStream input = (ImageInputStream) source; | ||
final byte[] b = new byte[140]; | ||
input.read(b); | ||
|
||
return ImageTypeFinder.getImageType(b).equals(ImageFormat.HEIC_IMAGE); | ||
|
||
} | ||
|
||
@Override | ||
public ImageReader createReaderInstance() throws IOException { | ||
return createReaderInstance("heic"); | ||
} | ||
} |
Oops, something went wrong.