commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1394361 - /commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
Date Fri, 05 Oct 2012 05:14:24 GMT
Author: damjan
Date: Fri Oct  5 05:14:23 2012
New Revision: 1394361

URL: http://svn.apache.org/viewvc?rev=1394361&view=rev
Log:
Test reading JPEG images (that we can).


Modified:
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java?rev=1394361&r1=1394360&r2=1394361&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
Fri Oct  5 05:14:23 2012
@@ -17,12 +17,14 @@
 
 package org.apache.commons.imaging.formats.jpeg;
 
+import java.awt.image.BufferedImage;
 import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.imaging.ImageInfo;
+import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.Imaging;
 import org.apache.commons.imaging.common.IImageMetadata;
 import org.apache.commons.imaging.util.Debug;
@@ -53,6 +55,14 @@ public class JpegReadTest extends JpegBa
 
             ImageInfo imageInfo = Imaging.getImageInfo(imageFile, params);
             assertNotNull(imageInfo);
+            
+            try {
+                BufferedImage image = Imaging.getBufferedImage(imageFile, params);
+                assertNotNull(image);
+            } catch (ImageReadException imageReadException) {
+                assertEquals("Only sequential, baseline JPEGs are supported at the moment",
+                        imageReadException.getMessage());
+            }
         }
     }
 



Mime
View raw message