mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-11 01:59:38 +02:00
Fixing dependencies.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@8276 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
466b7e2d08
commit
a3e9b99638
5 changed files with 45 additions and 30 deletions
|
@ -1,27 +1,16 @@
|
|||
package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api;
|
||||
|
||||
import com.sixlegs.png.PngImage;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Implements a default PNG Decoder
|
||||
* Implements a default PNG decoder.
|
||||
*/
|
||||
public class DefaultDecoder implements ImageDecoder{
|
||||
public class DefaultDecoder implements ImageDecoder {
|
||||
|
||||
PngImage decoder = new PngImage();
|
||||
|
||||
public BufferedImage decode(ByteArrayInputStream stream) {
|
||||
BufferedImage image = null;
|
||||
try {
|
||||
image = decoder.read(stream,true);
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
// Do nothing
|
||||
}
|
||||
return image;
|
||||
public BufferedImage decode(ByteArrayInputStream stream) throws IOException {
|
||||
return ImageIO.read(stream);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api;
|
|||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Image Decoder Interface use this interface if you want to change the default decoder
|
||||
|
@ -9,5 +10,6 @@ import java.io.ByteArrayInputStream;
|
|||
* @author Thiago Rocha Camargo
|
||||
*/
|
||||
public interface ImageDecoder {
|
||||
public BufferedImage decode(ByteArrayInputStream stream);
|
||||
|
||||
public BufferedImage decode(ByteArrayInputStream stream) throws IOException;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue