Skip to content

Commit

Permalink
fix another case of #740
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Mar 14, 2017
1 parent 35782ba commit b2d1bd0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mapnik_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3098,17 +3098,17 @@ void Image::EIO_FromSVGBytes(uv_work_t* req)
agg::scanline_u8 sl;

double opacity = 1;
int svg_width = svg.width() * closure->scale;
int svg_height = svg.height() * closure->scale;
double svg_width = svg.width() * closure->scale;
double svg_height = svg.height() * closure->scale;

if (svg_width <= 0 || svg_height <= 0)
{
closure->error = true;
closure->error_name = "image created from svg must have a width and height greater then zero";
return;
}

if (svg_width > static_cast<int>(closure->max_size) || svg_height > static_cast<int>(closure->max_size))
if (svg_width > static_cast<double>(closure->max_size) || svg_height > static_cast<double>(closure->max_size))
{
closure->error = true;
std::stringstream s;
Expand All @@ -3117,7 +3117,7 @@ void Image::EIO_FromSVGBytes(uv_work_t* req)
return;
}

mapnik::image_rgba8 im(svg_width, svg_height, true, true);
mapnik::image_rgba8 im(static_cast<int>(svg_width), static_cast<int>(svg_height), true, true);
agg::rendering_buffer buf(im.bytes(), im.width(), im.height(), im.row_size());
pixfmt pixf(buf);
renderer_base renb(pixf);
Expand Down

0 comments on commit b2d1bd0

Please sign in to comment.