From 3a7a1c07b584aec058f1a05fa43b4fcda490c33e Mon Sep 17 00:00:00 2001 From: Kyle Feuz Date: Mon, 9 Jun 2014 23:06:17 -0700 Subject: [PATCH 1/4] Fixes NPE when writing to disconnected client, Issue #2577 --- java/libraries/net/src/processing/net/Server.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/libraries/net/src/processing/net/Server.java b/java/libraries/net/src/processing/net/Server.java index 4cfeb784d..c03849c7f 100644 --- a/java/libraries/net/src/processing/net/Server.java +++ b/java/libraries/net/src/processing/net/Server.java @@ -309,8 +309,8 @@ public class Server implements Runnable { public void write(int data) { // will also cover char int index = 0; while (index < clientCount) { - clients[index].write(data); if (clients[index].active()) { + clients[index].write(data); index++; } else { removeIndex(index); @@ -322,8 +322,8 @@ public class Server implements Runnable { public void write(byte data[]) { int index = 0; while (index < clientCount) { - clients[index].write(data); if (clients[index].active()) { + clients[index].write(data); index++; } else { removeIndex(index); @@ -335,8 +335,8 @@ public class Server implements Runnable { public void write(String data) { int index = 0; while (index < clientCount) { - clients[index].write(data); if (clients[index].active()) { + clients[index].write(data); index++; } else { removeIndex(index); From 175d5e7a803c3351a219875127e26a87bab0db72 Mon Sep 17 00:00:00 2001 From: Joan Perals Tresserra Date: Sat, 23 Aug 2014 02:18:33 +0200 Subject: [PATCH 2/4] Prevent lerpColor from always rounding down --- core/src/processing/core/PGraphics.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index b2552442a..0787cf014 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -7680,10 +7680,10 @@ public class PGraphics extends PImage implements PConstants { float g2 = (c2 >> 8) & 0xff; float b2 = c2 & 0xff; - return (((int) (a1 + (a2-a1)*amt) << 24) | - ((int) (r1 + (r2-r1)*amt) << 16) | - ((int) (g1 + (g2-g1)*amt) << 8) | - ((int) (b1 + (b2-b1)*amt))); + return ((Math.round(a1 + (a2-a1)*amt) << 24) | + (Math.round(r1 + (r2-r1)*amt) << 16) | + (Math.round(g1 + (g2-g1)*amt) << 8) | + (Math.round(b1 + (b2-b1)*amt))); } else if (mode == HSB) { if (lerpColorHSB1 == null) { @@ -7693,7 +7693,7 @@ public class PGraphics extends PImage implements PConstants { float a1 = (c1 >> 24) & 0xff; float a2 = (c2 >> 24) & 0xff; - int alfa = ((int) (a1 + (a2-a1)*amt)) << 24; + int alfa = (Math.round(a1 + (a2-a1)*amt)) << 24; Color.RGBtoHSB((c1 >> 16) & 0xff, (c1 >> 8) & 0xff, c1 & 0xff, lerpColorHSB1); From 03f6acea8b34f1943dd3d2591e6b098bc18be9e0 Mon Sep 17 00:00:00 2001 From: Joan Perals Tresserra Date: Sat, 23 Aug 2014 02:32:47 +0200 Subject: [PATCH 3/4] Use PApplet.round instead of Math.round --- core/src/processing/core/PGraphics.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 0787cf014..3c68ac72f 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -7680,10 +7680,10 @@ public class PGraphics extends PImage implements PConstants { float g2 = (c2 >> 8) & 0xff; float b2 = c2 & 0xff; - return ((Math.round(a1 + (a2-a1)*amt) << 24) | - (Math.round(r1 + (r2-r1)*amt) << 16) | - (Math.round(g1 + (g2-g1)*amt) << 8) | - (Math.round(b1 + (b2-b1)*amt))); + return ((PApplet.round(a1 + (a2-a1)*amt) << 24) | + (PApplet.round(r1 + (r2-r1)*amt) << 16) | + (PApplet.round(g1 + (g2-g1)*amt) << 8) | + (PApplet.round(b1 + (b2-b1)*amt))); } else if (mode == HSB) { if (lerpColorHSB1 == null) { @@ -7693,7 +7693,7 @@ public class PGraphics extends PImage implements PConstants { float a1 = (c1 >> 24) & 0xff; float a2 = (c2 >> 24) & 0xff; - int alfa = (Math.round(a1 + (a2-a1)*amt)) << 24; + int alfa = (PApplet.round(a1 + (a2-a1)*amt)) << 24; Color.RGBtoHSB((c1 >> 16) & 0xff, (c1 >> 8) & 0xff, c1 & 0xff, lerpColorHSB1); From b8929890086b3114ea6be2f56848706e35281cba Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 14 Nov 2014 14:36:08 -0700 Subject: [PATCH 4/4] notes about pull requests and new Java version --- build/build.xml | 2 +- core/todo.txt | 11 +++++++++++ todo.txt | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/build/build.xml b/build/build.xml index f52d1f639..8c776d0a1 100755 --- a/build/build.xml +++ b/build/build.xml @@ -154,7 +154,7 @@ - + diff --git a/core/todo.txt b/core/todo.txt index 433a323ce..92ea0f3f7 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,5 +1,16 @@ 0232 core (3.0a5) +_ simple to detect CMYK JPEG images? +_ https://community.oracle.com/thread/1272045?start=0&tstart=0 +_ int colorSpace = img.getColorModel().getColorSpace().getType(); +int colorSpace = img.getColorModel().getColorSpace().getType(); +if(colorSpace == ColorSpace.TYPE_CMYK) { + BufferedImage dst = new BufferedImage(img.getWidth(), + img.getHeight(),BufferedImage.TYPE_3BYTE_BGR); + ColorConvertOp op = new ColorConvertOp(null); + op.filter(img, dst); + img = dst; +} pulls X Fix check in loadShader() diff --git a/todo.txt b/todo.txt index 6c0fb47f3..957cb6cb5 100644 --- a/todo.txt +++ b/todo.txt @@ -18,6 +18,12 @@ X improve contrib manager localization X https://github.com/processing/processing/pull/2870 X Fix infinite recursion in sound library X https://github.com/processing/processing/pull/2897 +X NullPointerException message when Server writes to a disconnected client +X https://github.com/processing/processing/issues/2577 +X https://github.com/processing/processing/pull/2578 +X Prevent lerpColor from always rounding down +X https://github.com/processing/processing/issues/2812 +X https://github.com/processing/processing/pull/2813 _ Add support for localizing contributions _ https://github.com/processing/processing/pull/2833 _ Fix renaming from RGB to Rgb.java and others @@ -72,6 +78,8 @@ _ http://stackoverflow.com/questions/4933677/detecting-windows-ie-proxy-settin _ http://www.java2s.com/Code/Java/Network-Protocol/DetectProxySettingsforInternetConnection.htm _ problems with non-US keyboards and some shortcuts _ https://github.com/processing/processing/issues/2199 +_ improve start time by populating sketchbook/libraries on threads +_ https://github.com/processing/processing/issues/2945 medium