Browse Source

Never use floating point to set array sizes 😈

Fix issue #380


Former-commit-id: a29ce1d8aaafaaaf4f2436b7c112860f39e4636f
Former-commit-id: a37dcea6a5bdf5ee48cf7d3f2ef1d4498c5f8d32
Former-commit-id: a8dae8a8bf62a75b936db60b6eb729ad314be2f6
af/merge-core
James Jackson-South 10 years ago
parent
commit
d09629722e
  1. 4
      src/ImageProcessorCore/Samplers/Resampler.cs

4
src/ImageProcessorCore/Samplers/Resampler.cs

@ -80,7 +80,7 @@ namespace ImageProcessorCore.Samplers
result[i] = new Weights
{
Sum = 0,
Values = new Weight[(int)Math.Floor((2 * width) + 1)]
Values = new Weight[(int)(right - left + 1)]
};
for (double j = left; j <= right; j++)
@ -116,7 +116,7 @@ namespace ImageProcessorCore.Samplers
result[i] = new Weights
{
Sum = 0,
Values = new Weight[(int)((radius * 2) + 1)]
Values = new Weight[(int)(right - left + 1)]
};
for (double j = left; j <= right; j++)

Loading…
Cancel
Save