node-mapnik icon indicating copy to clipboard operation
node-mapnik copied to clipboard

max_size is ambiguously defined in the docs

Open mcwhittemore opened this issue 8 years ago • 2 comments

The check to see if the SVG is too large checks width and height separately while the documentation states that max_size is the maximum allowed size of the svg dimensions * scale.

Reading this over a few times, I think this is a correct statement, but on first pass the docs seemed to imply area width * height * scale^2 while the code enforces longest side Math.max(width, height) * scale.

As the goal of this check is to make sure too much memory is not allocated for an Image, it seems that the area of the image is what we should be enforcing here. Does that sound right @flippmoke and @springmeyer?

mcwhittemore avatar Jun 28 '17 15:06 mcwhittemore

@mcwhittemore - area 👍

artemp avatar Jun 28 '17 15:06 artemp

Thanks @artemp. I'll make a PR to fix this.

mcwhittemore avatar Jun 28 '17 15:06 mcwhittemore