You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by vs...@apache.org on 2008/12/08 12:17:25 UTC

svn commit: r724308 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java

Author: vsiveton
Date: Mon Dec  8 03:17:25 2008
New Revision: 724308

URL: http://svn.apache.org/viewvc?rev=724308&view=rev
Log:
o support only PPM type for image

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java?rev=724308&r1=724307&r2=724308&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java Mon Dec  8 03:17:25 2008
@@ -1114,11 +1114,6 @@
     /** {@inheritDoc} */
     public void figureGraphics( String name )
     {
-        if ( !name.endsWith( ".ppm" ) )
-        {
-            getLog().warn( "Unsupported image type: " + name );
-        }
-
         Paragraph p = new Paragraph();
         p.justification = Sink.JUSTIFY_CENTER;
         beginParagraph( p );
@@ -1138,6 +1133,14 @@
     private void writeImage( String source )
         throws Exception
     {
+        if ( !source.toLowerCase().endsWith( ".ppm" ) )
+        {
+            // TODO support more image types!
+            getLog().warn( "Unsupported image type for image file: '" + source + "'.");
+            getLog().warn( "Only PPM image type is currently supported.");
+            return;
+        }
+
         int bytesPerLine;
         PBMReader ppm = new PBMReader( source );
         WMFWriter.Dib dib = new WMFWriter.Dib();
@@ -1172,7 +1175,6 @@
                 }
             }
         }
-
         else
         {
             dib.biBitCount = 8;
@@ -1303,7 +1305,6 @@
                 wmf.print( writer );
             }
         }
-
         else
         {
             if ( imageDataFormat.equals( IMG_DATA_RAW ) )