diff options
author | Taeyoung Son <taeyoung2.son@samsung.com> | 2014-08-04 20:43:09 +0900 |
---|---|---|
committer | Taeyoung Son <taeyoung2.son@samsung.com> | 2014-08-04 04:47:05 -0700 |
commit | 89f4086dc297198be50a366b26e18a52b64f041b (patch) | |
tree | 8e217c932db2ca812a0d08885242fa76a022e1e9 | |
parent | c0677aad6d0a52cd3936fce919d70d8ecd5991dd (diff) | |
download | common-eplugin-89f4086dc297198be50a366b26e18a52b64f041b.tar.gz common-eplugin-89f4086dc297198be50a366b26e18a52b64f041b.tar.bz2 common-eplugin-89f4086dc297198be50a366b26e18a52b64f041b.zip |
COMMON: Fixed bug in image util.
Fixed bug in image util.
Change-Id: I4371bf40664c30955a02d332edc3b9ee8101bfd1
Signed-off-by: Taeyoung Son <taeyoung2.son@samsung.com>
-rw-r--r-- | org.tizen.common/src/org/tizen/common/util/ImageUtil.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/org.tizen.common/src/org/tizen/common/util/ImageUtil.java b/org.tizen.common/src/org/tizen/common/util/ImageUtil.java index b9003e5b7..d8647c472 100644 --- a/org.tizen.common/src/org/tizen/common/util/ImageUtil.java +++ b/org.tizen.common/src/org/tizen/common/util/ImageUtil.java @@ -256,15 +256,15 @@ public class ImageUtil { */ public static List<BufferedImage> getAWTImages(InputStream is, String iconFilePath) throws IOException { List<BufferedImage> images = new ArrayList<BufferedImage>(); - String formatName = getFormatName(iconFilePath); - if ( !StringUtil.isEmpty(formatName) ) { - if (formatName.equalsIgnoreCase(ICO)) { + String extension = FilenameUtil.getExtension(iconFilePath); + if ( !StringUtil.isEmpty(extension) ) { + if (extension.equalsIgnoreCase(ICO)) { images = ICODecoder.read(is); - } else if (formatName.equalsIgnoreCase(BMP)) { + } else if (extension.equalsIgnoreCase(BMP)) { images.add(BMPDecoder.read(is)); - } else if (formatName.equalsIgnoreCase(SVG)) { + } else if (extension.equalsIgnoreCase(SVG)) { SVGUniverse svgUnverse = new SVGUniverse(); - URI iconUri = svgUnverse.loadSVG(is, formatName); + URI iconUri = svgUnverse.loadSVG(is, extension); if (iconUri == null) { return images; } @@ -582,19 +582,19 @@ public class ImageUtil { /** * Writes <code>BufferedImage</code> to <code>OutputStream</code>. * @param bImg <code>BufferedImage</code> - * @param formatName + * @param extension * @param os <code>OutputStream</code> * @throws IOException */ - public static void write(BufferedImage bImg, String formatName, OutputStream os) throws IOException { - if (ICO.equalsIgnoreCase(formatName)) { + public static void write(BufferedImage bImg, String extension, String formatName, OutputStream os) throws IOException { + if (ICO.equalsIgnoreCase(extension)) { ICOEncoder.write(bImg, os); - } else if (BMP.equalsIgnoreCase(formatName)) { + } else if (BMP.equalsIgnoreCase(extension)) { BMPEncoder.write(bImg, os); - } else if (SVG.equalsIgnoreCase(formatName)) { + } else if (SVG.equalsIgnoreCase(extension)) { // INFO:: Don't support svg format } else { - ImageIO.write(bImg, formatName, os); + ImageIO.write(bImg, extension, os); } } |