pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1730881 - in /pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight: content/ContentStreamEngine.java graphic/ColorSpaces.java graphic/DeviceColorSpaceHelper.java graphic/StandardColorSpaceHelper.java
Date Wed, 17 Feb 2016 17:27:12 GMT
Author: tilman
Date: Wed Feb 17 17:27:12 2016
New Revision: 1730881

URL: http://svn.apache.org/viewvc?rev=1730881&view=rev
Log:
PDFBOX-3235: rename colorspaces like in 2.0; improve message

Modified:
    pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/content/ContentStreamEngine.java
    pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
    pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
    pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java

Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/content/ContentStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/content/ContentStreamEngine.java?rev=1730881&r1=1730880&r2=1730881&view=diff
==============================================================================
--- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/content/ContentStreamEngine.java
(original)
+++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/content/ContentStreamEngine.java
Wed Feb 17 17:27:12 2016
@@ -341,7 +341,7 @@ public abstract class ContentStreamEngin
 
                 if (cs == null)
                 {
-                    registerError("The ColorSpace is unknown", ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY);
+                    registerError("The ColorSpace " + colorSpace + " is unknown", ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY);
                     return;
                 }
             }
@@ -597,7 +597,7 @@ public abstract class ContentStreamEngin
 
         if (cs == null)
         {
-            registerError("The ColorSpace is unknown", ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY);
+            registerError("The ColorSpace " + colorSpaceName + " is unknown", ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY);
             return;
         }
 

Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java?rev=1730881&r1=1730880&r2=1730881&view=diff
==============================================================================
--- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
(original)
+++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
Wed Feb 17 17:27:12 2016
@@ -29,9 +29,9 @@ package org.apache.pdfbox.preflight.grap
 public enum ColorSpaces
 {
 
-    Lab("Lab"), CalRGB("CalRGB"), CalGray("CalGray"), DeviceN("DeviceN"), Indexed("Indexed"),
Indexed_SHORT("I"), Pattern(
-            "Pattern"), ICCBased("ICCBased"), DeviceRGB("DeviceRGB"), DeviceRGB_SHORT("RGB"),
DeviceGray("DeviceGray"), DeviceGray_SHORT(
-            "G"), DeviceCMYK("DeviceCMYK"), DeviceCMYK_SHORT("CMYK"), Separation("Separation");
+    Lab("Lab"), CalRGB("CalRGB"), CalGray("CalGray"), DeviceN("DeviceN"), Indexed("Indexed"),
I("I"), Pattern(
+            "Pattern"), ICCBased("ICCBased"), DeviceRGB("DeviceRGB"), RGB("RGB"), DeviceGray("DeviceGray"),
G(
+            "G"), DeviceCMYK("DeviceCMYK"), CMYK("CMYK"), Separation("Separation");
 
     /**
      * Name of the ColorSpace

Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java?rev=1730881&r1=1730880&r2=1730881&view=diff
==============================================================================
--- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
(original)
+++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
Wed Feb 17 17:27:12 2016
@@ -79,7 +79,7 @@ public class DeviceColorSpaceHelper exte
             switch (colorSpace)
             {
             case Indexed:
-            case Indexed_SHORT:
+            case I:
             case Pattern:
                 context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_FORBIDDEN,
colorSpace
                         .getLabel() + " ColorSpace is forbidden"));

Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java?rev=1730881&r1=1730880&r2=1730881&view=diff
==============================================================================
--- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
(original)
+++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
Wed Feb 17 17:27:12 2016
@@ -96,9 +96,6 @@ public class StandardColorSpaceHelper im
      * 
      * @param pdcs
      *            the color space object to check.
-     * @param result
-     *            the list of error to update if the validation fails.
-     * @return true if the validation succeed, false otherwise.
      */
     protected final void processAllColorSpace(PDColorSpace pdcs)
     {
@@ -107,11 +104,11 @@ public class StandardColorSpaceHelper im
         switch (cs)
         {
         case DeviceRGB:
-        case DeviceRGB_SHORT:
+        case RGB:
             processRGBColorSpace(pdcs);
             break;
         case DeviceCMYK:
-        case DeviceCMYK_SHORT:
+        case CMYK:
             processCYMKColorSpace(pdcs);
             break;
         case CalRGB:
@@ -120,7 +117,7 @@ public class StandardColorSpaceHelper im
             processCalibratedColorSpace(pdcs);
             break;
         case DeviceGray:
-        case DeviceGray_SHORT:
+        case G:
             processGrayColorSpace(pdcs);
             break;
         case ICCBased:
@@ -130,7 +127,7 @@ public class StandardColorSpaceHelper im
             processDeviceNColorSpace(pdcs);
             break;
         case Indexed:
-        case Indexed_SHORT:
+        case I:
             processIndexedColorSpace(pdcs);
             break;
         case Separation:
@@ -353,7 +350,7 @@ public class StandardColorSpaceHelper im
         {
             PDColorSpace based = indexed.getBaseColorSpace();
             ColorSpaces cs = ColorSpaces.valueOf(based.getName());
-            if (cs == ColorSpaces.Indexed || cs == ColorSpaces.Indexed_SHORT)
+            if (cs == ColorSpaces.Indexed || cs == ColorSpaces.I)
             {
                 context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_INDEXED,
                         "Indexed color space can't be used as Base color space"));
@@ -398,7 +395,7 @@ public class StandardColorSpaceHelper im
                 case DeviceN:
                 case Pattern:
                 case Indexed:
-                case Indexed_SHORT:
+                case I:
                     context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_ALTERNATE,
acs
                             .getLabel() + " color space can't be used as alternate color
space"));
                     break;



Mime
View raw message