[seam-commits] Seam SVN: r15504 - branches/enterprise/JBPAPP_5_1_0_JBPAPP-10747/ui/src/main/java/org/jboss/seam/ui/graphicImage.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue May 14 14:15:19 EDT 2013


Author: ivassile
Date: 2013-05-14 14:15:18 -0400 (Tue, 14 May 2013)
New Revision: 15504

Modified:
   branches/enterprise/JBPAPP_5_1_0_JBPAPP-10747/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
Log:
Fix for one-off patch https://issues.jboss.org/browse/JBPAPP-10747

Modified: branches/enterprise/JBPAPP_5_1_0_JBPAPP-10747/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
===================================================================
--- branches/enterprise/JBPAPP_5_1_0_JBPAPP-10747/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java	2013-05-14 17:23:38 UTC (rev 15503)
+++ branches/enterprise/JBPAPP_5_1_0_JBPAPP-10747/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java	2013-05-14 18:15:18 UTC (rev 15504)
@@ -44,7 +44,7 @@
    public enum Type
    {
       IMAGE_PNG("image/png", ".png", "PNG"), IMAGE_JPEG("image/jpeg", ".jpg", "JPEG", "image/jpg"), IMAGE_GIF(
-               "image/gif", ".gif", "GIF");
+               "image/gif", ".gif", "GIF"), IMAGE_BMP("image/bmp", ".bmp", "BMP");
 
       private String mimeType;
 
@@ -474,7 +474,12 @@
       ImageReadParam param = reader.getDefaultReadParam();
       reader.setInput(stream, true, true);
       String type = reader.getFormatName();
-      setContentType(Type.getTypeByFormatName(type));
+      Type contentType = Type.getTypeByFormatName(type);
+      if (contentType == null)
+      {
+         throw new IllegalArgumentException("The image type is not supported");
+      }
+      setContentType(contentType);
       bufferedImage = reader.read(0, param);
       stream.close();
       reader.dispose();



More information about the seam-commits mailing list