Author: acumiskey
Date: Mon Apr 21 02:51:21 2008
New Revision: 650069

URL: http://svn.apache.org/viewvc?rev=650069&view=rev
Log:
Merged revisions 649657,650050 via svnmerge from 
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r649657 | spepping | 2008-04-18 20:07:57 +0100 (Fri, 18 Apr 2008) | 4 lines
  
  An implementation of a positive integer property maker. It implements
  convertProperty, which is the correct method to implement if one wants
  to add to the make process. This fixes bug 44619.
........
  r650050 | jeremias | 2008-04-21 09:32:02 +0100 (Mon, 21 Apr 2008) | 1 line
  
  Partially reverted my revision 641827: The yellow tint of certain JPEG images 
came from badly extracted ICC color profiles. This is fixed in XML Graphics 
Commons Trunk (revision 650048).
........

Modified:
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/   (props changed)
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/FOPropertyMapping.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/properties/NumberProperty.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Apr 21 02:51:21 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-649598
+/xmlgraphics/fop/trunk:1-650056

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=650069&r1=650068&r2=650069&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/FOPropertyMapping.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/FOPropertyMapping.java
 Mon Apr 21 02:51:21 2008
@@ -1095,13 +1095,13 @@
         addPropertyMaker("hyphenation-character", m);
 
         // hyphenation-push-character-count
-        m  = new NumberProperty.Maker(PR_HYPHENATION_PUSH_CHARACTER_COUNT);
+        m  = new 
NumberProperty.PositiveIntegerMaker(PR_HYPHENATION_PUSH_CHARACTER_COUNT);
         m.setInherited(true);
         m.setDefault("2");
         addPropertyMaker("hyphenation-push-character-count", m);
 
         // hyphenation-remain-character-count
-        m  = new NumberProperty.Maker(PR_HYPHENATION_REMAIN_CHARACTER_COUNT);
+        m  = new 
NumberProperty.PositiveIntegerMaker(PR_HYPHENATION_REMAIN_CHARACTER_COUNT);
         m.setInherited(true);
         m.setDefault("2");
         addPropertyMaker("hyphenation-remain-character-count", m);
@@ -2137,7 +2137,7 @@
         addPropertyMaker("blank-or-not-blank", m);
 
         // column-count
-        m  = new NumberProperty.Maker(PR_COLUMN_COUNT);
+        m  = new NumberProperty.PositiveIntegerMaker(PR_COLUMN_COUNT);
         m.setInherited(false);
         m.setDefault("1");
         addPropertyMaker("column-count", m);
@@ -2175,7 +2175,7 @@
         addPropertyMaker("force-page-count", m);
 
         // initial-page-number
-        m  = new NumberProperty.Maker(PR_INITIAL_PAGE_NUMBER);
+        m  = new NumberProperty.PositiveIntegerMaker(PR_INITIAL_PAGE_NUMBER);
         m.setInherited(false);
         m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
         m.addEnum("auto-odd", getEnumProperty(EN_AUTO_ODD, "AUTO_ODD"));
@@ -2359,19 +2359,19 @@
         addPropertyMaker("ends-row", m);
 
         // number-columns-repeated
-        m  = new NumberProperty.Maker(PR_NUMBER_COLUMNS_REPEATED);
+        m  = new 
NumberProperty.PositiveIntegerMaker(PR_NUMBER_COLUMNS_REPEATED);
         m.setInherited(false);
         m.setDefault("1");
         addPropertyMaker("number-columns-repeated", m);
 
         // number-columns-spanned
-        m  = new NumberProperty.Maker(PR_NUMBER_COLUMNS_SPANNED);
+        m  = new 
NumberProperty.PositiveIntegerMaker(PR_NUMBER_COLUMNS_SPANNED);
         m.setInherited(false);
         m.setDefault("1");
         addPropertyMaker("number-columns-spanned", m);
 
         // number-rows-spanned
-        m  = new NumberProperty.Maker(PR_NUMBER_ROWS_SPANNED);
+        m  = new NumberProperty.PositiveIntegerMaker(PR_NUMBER_ROWS_SPANNED);
         m.setInherited(false);
         m.setDefault("1");
         addPropertyMaker("number-rows-spanned", m);

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java?rev=650069&r1=650068&r2=650069&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/flow/table/TableFObj.java
 Mon Apr 21 02:51:21 2008
@@ -117,7 +117,7 @@
      * PropertyMaker subclass for the column-number property
      *
      */
-    public static class ColumnNumberPropertyMaker extends NumberProperty.Maker 
{
+    public static class ColumnNumberPropertyMaker extends 
NumberProperty.PositiveIntegerMaker {
 
         /**
          * Constructor
@@ -153,24 +153,6 @@
                     = (ColumnNumberManagerHolder) propertyList.getParentFObj();
             ColumnNumberManager columnIndexManager =  
parent.getColumnNumberManager();
             int columnIndex = p.getNumeric().getValue();
-            if (columnIndex <= 0) {
-                /* No warning necessary as the spec clearly defines how to 
handle these cases.
-                log.warn("Specified negative or zero value for "
-                        + "column-number on " + fo.getName() + ": "
-                        + columnIndex + " forced to "
-                        + columnIndexManager.getCurrentColumnNumber());*/
-                return 
NumberProperty.getInstance(columnIndexManager.getCurrentColumnNumber());
-            } else {
-                double tmpIndex = p.getNumeric().getNumericValue();
-                if (tmpIndex - columnIndex > 0.0) {
-                    columnIndex = (int) Math.round(tmpIndex);
-                    /* No warning necessary as the spec clearly defines how to 
handle these cases.
-                    log.warn("Rounding specified column-number of "
-                            + tmpIndex + " to " + columnIndex);*/
-                    p = NumberProperty.getInstance(columnIndex);
-                }
-            }
-
             int colSpan = propertyList.get(Constants.PR_NUMBER_COLUMNS_SPANNED)
                                 .getNumeric().getValue();
             int i = -1;

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/properties/NumberProperty.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/properties/NumberProperty.java?rev=650069&r1=650068&r2=650069&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/properties/NumberProperty.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/properties/NumberProperty.java
 Mon Apr 21 02:51:21 2008
@@ -68,6 +68,40 @@
 
     }
 
+    public static class PositiveIntegerMaker extends PropertyMaker {
+
+        /**
+         * Constructor for NumberProperty.PositiveIntegerMaker
+         * @param propId the id of the property for which a 
PositiveIntegerMaker should be created
+         */
+        public PositiveIntegerMaker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * If the value is not positive, return a property with value 1 
+         * 
+         * [EMAIL PROTECTED]
+         */
+        public Property convertProperty(Property p, 
+                                        PropertyList propertyList, FObj fo) 
+                    throws PropertyException {
+            if (p instanceof EnumProperty) {
+                return EnumNumber.getInstance(p);
+            }
+            Number val = p.getNumber();
+            if (val != null) {
+                int i = val.intValue();
+                if (i <= 0) {
+                    i = 1;
+                }
+                return getInstance(i);
+            }
+            return convertPropertyDatatype(p, propertyList, fo);
+        }
+
+    }
+    
     /** cache holding all canonical NumberProperty instances */
     private static final PropertyCache cache = new PropertyCache();
     

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java?rev=650069&r1=650068&r2=650069&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
 Mon Apr 21 02:51:21 2008
@@ -18,7 +18,6 @@
 /* $Id$ */
 
 package org.apache.fop.render.pdf;
-import java.awt.color.ICC_Profile;
 import java.io.DataInput;
 import java.io.IOException;
 import java.io.InputStream;
@@ -36,7 +35,6 @@
 import org.apache.fop.pdf.PDFDocument;
 import org.apache.fop.pdf.PDFFilter;
 import org.apache.fop.pdf.PDFFilterList;
-import org.apache.fop.util.ColorProfileUtil;
 
 /**
  * PDFImage implementation for the PDF renderer which handles raw JPEG images.
@@ -81,21 +79,6 @@
         return toPDFColorSpace(getImageColorSpace());
     }
 
-    /** [EMAIL PROTECTED] */
-    protected ICC_Profile getEffectiveICCProfile() {
-        ICC_Profile profile = super.getEffectiveICCProfile();
-        if (profile != null 
-                && profile.getNumComponents() == 3
-                && !ColorProfileUtil.isDefaultsRGB(profile)) {
-            //RGB profiles which are not sRGB don't seem to work.
-            //Without this override, the image drifts into yellow for an 
unknown reason.
-            //TODO Find out why this happens.
-            //Test using a JPEG images with, for example, "Adobe RGB 1998" 
color profile.
-            profile = null;
-        }
-        return profile;
-    }
-    
     /** [EMAIL PROTECTED] */
     public int getBitsPerComponent() {
         return 8;

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml?rev=650069&r1=650068&r2=650069&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml Mon Apr 21 
02:51:21 2008
@@ -82,11 +82,6 @@
         When a JPEG image is embedded, an optionally embedded color profile is 
filtered out
         as it's already embedded separately in the PDF file.
       </action>
-      <action context="Renderers" dev="JM" type="fix">
-        Worked around a problem (PDF renderer) with JPEG image containing RGB 
color profiles which
-        are not sRGB. The images drifted into yellow. The color profile is 
simply disabled in this
-        case. Please let us know if you know what the problem could be.
-      </action>
       <action context="Fonts" dev="JM" type="add">
         Added support for addressing all glyphs available in a Type 1 font, 
not just the ones
         in the font's primary encoding.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to