mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-09 17:44:10 +00:00
Fixed #2116 Limit maximum number of box blur pixels
This commit is contained in:
@@ -977,7 +977,7 @@ public final class Configuration {
|
||||
@ConfigurationCategory("format")
|
||||
public static ConfigurationItem<Integer> tabSize = null;
|
||||
|
||||
@ConfigurationDefaultInt(1000000)
|
||||
@ConfigurationDefaultInt(1000)
|
||||
@ConfigurationCategory("limit")
|
||||
public static ConfigurationItem<Integer> boxBlurPixelsLimit = null;
|
||||
|
||||
|
||||
@@ -63,17 +63,14 @@ public class Filtering {
|
||||
if (radiusY == 0) {
|
||||
radiusY = 1;
|
||||
}
|
||||
|
||||
int radiusXHalf = radiusX / 2;
|
||||
int radiusYHalf = radiusY / 2;
|
||||
double divisor = radiusX * radiusY;
|
||||
|
||||
long limit = Configuration.boxBlurPixelsLimit.get() * 10000L;
|
||||
|
||||
if ((long) w * (long) h > Configuration.boxBlurPixelsLimit.get()) {
|
||||
if ((long) w * (long) h > limit) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (((long) radiusY * (long) radiusX * (long) w * (long) h) > Configuration.boxBlurPixelsLimit.get()) {
|
||||
while (((long) radiusY * (long) radiusX * (long) w * (long) h) > limit) {
|
||||
// decrease radius
|
||||
if (radiusY > 1) {
|
||||
radiusY--;
|
||||
@@ -82,6 +79,10 @@ public class Filtering {
|
||||
radiusX--;
|
||||
}
|
||||
}
|
||||
|
||||
int radiusXHalf = radiusX / 2;
|
||||
int radiusYHalf = radiusY / 2;
|
||||
double divisor = radiusX * radiusY;
|
||||
|
||||
for (int y = 0; y < h; y++) {
|
||||
for (int x = 0; x < w; x++) {
|
||||
|
||||
Reference in New Issue
Block a user