xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r595305 - in /xmlgraphics/fop/branches/Temp_ImagePackageRedesign: src/java/org/apache/fop/image2/impl/PreloaderJPEG.java test/java/org/apache/fop/image2/ImagePreloaderTestCase.java
Date Thu, 15 Nov 2007 14:01:37 GMT
Author: jeremias
Date: Thu Nov 15 06:01:37 2007
New Revision: 595305

URL: http://svn.apache.org/viewvc?rev=595305&view=rev
Log:
Small mistake while reimplementing JPEG.

Modified:
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/PreloaderJPEG.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/java/org/apache/fop/image2/ImagePreloaderTestCase.java

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/PreloaderJPEG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/PreloaderJPEG.java?rev=595305&r1=595304&r2=595305&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/PreloaderJPEG.java
(original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/PreloaderJPEG.java
Thu Nov 15 06:01:37 2007
@@ -120,8 +120,8 @@
                 case SOFA:
                     in.skipBytes(2); //length field
                     in.skipBytes(1);
-                    int width = in.readUnsignedShort();
                     int height = in.readUnsignedShort();
+                    int width = in.readUnsignedShort();
                     size.setSizeInPixels(width, height);
                     size.calcSizeFromPixels();
                     return size;

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/java/org/apache/fop/image2/ImagePreloaderTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/java/org/apache/fop/image2/ImagePreloaderTestCase.java?rev=595305&r1=595304&r2=595305&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/java/org/apache/fop/image2/ImagePreloaderTestCase.java
(original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/java/org/apache/fop/image2/ImagePreloaderTestCase.java
Thu Nov 15 06:01:37 2007
@@ -179,7 +179,7 @@
         assertEquals(56665, info.getSize().getHeightMpt());
     }
  
-    public void testJPEG() throws Exception {
+    public void testJPEG1() throws Exception {
         String uri = "test/resources/images/bgimg300dpi.jpg";
         
         FOUserAgent userAgent = fopFactory.newFOUserAgent();
@@ -194,6 +194,23 @@
         assertEquals(300, info.getSize().getDpiHorizontal(), 0.1);
         assertEquals(46080, info.getSize().getWidthMpt());
         assertEquals(46080, info.getSize().getHeightMpt());
+    }
+ 
+    public void testJPEG2() throws Exception {
+        String uri = "test/resources/images/cmyk.jpg";
+        
+        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        
+        ImageManager manager = fopFactory.getImageManager();
+        ImageInfo info = manager.preloadImage(uri, userAgent);
+        assertNotNull("ImageInfo must not be null", info);
+        assertEquals(MimeConstants.MIME_JPEG, info.getMimeType());
+        assertEquals(uri, info.getOriginalURI());
+        assertEquals(160, info.getSize().getWidthPx());
+        assertEquals(35, info.getSize().getHeightPx());
+        assertEquals(72, info.getSize().getDpiHorizontal(), 0.1);
+        assertEquals(160000, info.getSize().getWidthMpt());
+        assertEquals(35000, info.getSize().getHeightMpt());
     }
  
     public void testBMP() throws Exception {



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message