You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by de...@apache.org on 2002/02/11 19:03:42 UTC
cvs commit: xml-batik/sources/org/apache/batik/util RunnableQueue.java
deweese 02/02/11 10:03:42
Modified: sources/org/apache/batik/transcoder/image PNGTranscoder.java
sources/org/apache/batik/util RunnableQueue.java
Log:
1) PNGTranscoder now ensures an sRGB chunk is written
2) Plugged a race condition in the RunnableQueue (thanks Stephane)
Revision Changes Path
1.11 +9 -5 xml-batik/sources/org/apache/batik/transcoder/image/PNGTranscoder.java
Index: PNGTranscoder.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/image/PNGTranscoder.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- PNGTranscoder.java 7 Feb 2002 13:10:17 -0000 1.10
+++ PNGTranscoder.java 11 Feb 2002 18:03:42 -0000 1.11
@@ -26,7 +26,7 @@
* This class is an <tt>ImageTranscoder</tt> that produces a PNG image.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
- * @version $Id: PNGTranscoder.java,v 1.10 2002/02/07 13:10:17 tkormann Exp $
+ * @version $Id: PNGTranscoder.java,v 1.11 2002/02/11 18:03:42 deweese Exp $
*/
public class PNGTranscoder extends ImageTranscoder {
@@ -63,12 +63,16 @@
PNGEncodeParam.RGB params =
(PNGEncodeParam.RGB)PNGEncodeParam.getDefaultEncodeParam(img);
params.setBackgroundRGB(new int [] { 255, 255, 255 });
+
+ // If they specify GAMMA key then use it otherwise don't
+ // write a gAMA chunk, (default Gamma=2.2).
if (hints.containsKey(KEY_GAMMA)) {
params.setGamma(((Float)hints.get(KEY_GAMMA)).floatValue());
- } else {
- // We are using sRGB (gamma 2.2).
- params.setSRGBIntent(PNGEncodeParam.INTENT_PERCEPTUAL);
- }
+ }
+
+ // We always want an sRGB chunk and Our encoding intent is
+ // perceptual
+ params.setSRGBIntent(PNGEncodeParam.INTENT_PERCEPTUAL);
//
// This is a trick so that viewers which do not support the alpha
1.8 +10 -1 xml-batik/sources/org/apache/batik/util/RunnableQueue.java
Index: RunnableQueue.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/RunnableQueue.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RunnableQueue.java 11 Feb 2002 13:14:30 -0000 1.7
+++ RunnableQueue.java 11 Feb 2002 18:03:42 -0000 1.8
@@ -16,7 +16,7 @@
* invocation in a single thread.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: RunnableQueue.java,v 1.7 2002/02/11 13:14:30 hillion Exp $
+ * @version $Id: RunnableQueue.java,v 1.8 2002/02/11 18:03:42 deweese Exp $
*/
public class RunnableQueue implements Runnable {
@@ -138,7 +138,16 @@
}
}
+ // The following seriously stress tests the class
+ // for stuff happening between the two sync blocks.
+ //
+ // try {
+ // Thread.sleep(1);
+ // } catch (InterruptedException ie) { }
+
synchronized (list) {
+ if (state == SUSPENDING)
+ continue;
l = (Link)list.pop();
if (l == null) {
// No item to run, wait till there is one.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org