You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by de...@apache.org on 2006/09/01 04:23:40 UTC

svn commit: r439138 - in /xmlgraphics/batik/trunk/sources/org/apache/batik: apps/svgbrowser/Main.java ext/awt/image/codec/tiff/TIFFImageEncoder.java

Author: deweese
Date: Thu Aug 31 19:23:39 2006
New Revision: 439138

URL: http://svn.apache.org/viewvc?rev=439138&view=rev
Log:
1) UserAgent Stylesheet file is now converted to a URL.
2) Bug 39755, fixed (Writing TIFF with JPEG compression fails)
   Thanks to Matthias for the report.


Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java?rev=439138&r1=439137&r2=439138&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/Main.java Thu Aug 31 19:23:39 2006
@@ -715,8 +715,18 @@
      * @return null if no user style sheet was specified.
      */
     public String getUserStyleSheetURI() {
-        return preferenceManager.getString
+        String ssPath = preferenceManager.getString
             (PreferenceDialog.PREFERENCE_KEY_USER_STYLESHEET);
+        if (ssPath.length() == 0) return null;
+        try {
+            File f = new File(ssPath);
+            if (f.exists()) {
+                return f.toURL().toString();
+            }
+        } catch (IOException ioe) {
+            // Nothing...
+        }
+        return ssPath;
     }
 
     /**

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java?rev=439138&r1=439137&r2=439138&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java Thu Aug 31 19:23:39 2006
@@ -675,8 +675,8 @@
             // YCbCr positioning.
             fields.add(new TIFFField(TIFF_YCBCR_POSITIONING,
                                      TIFFField.TIFF_SHORT, 1, 
-                                     new int[] {compression == COMP_JPEG_TTN2 ?
-                                                1 : 2}));
+                                     new char[] 
+                {(char)((compression == COMP_JPEG_TTN2)? 1 : 2)}));
 
             // Reference black/white.
             long[][] refbw;