8000 Fix creation of AGG images bigger than 1024**3 pixels by pkgw · Pull Request #19210 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix creation of AGG images bigger than 1024**3 pixels #19210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extern/agg24-svn/include/agg_rasterizer_cells_aa.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ namespace agg
int cy = (y1 + y2) >> 1;
line(x1, y1, cx, cy);
line(cx, cy, x2, y2);
return;
}

int dy = y2 - y1;
Expand Down
2 changes: 1 addition & 1 deletion src/_backend_agg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi)
: width(width),
height(height),
dpi(dpi),
NUMBYTES(width * height * 4),
NUMBYTES((size_t)width * (size_t)height * 4),
pixBuffer(NULL),
renderingBuffer(),
alphaBuffer(NULL),
Expand Down
4 changes: 2 additions & 2 deletions src/_backend_agg_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int PyBufferRegion_get_buffer(PyBufferRegion *self, Py_buffer *buf, int flags)
Py_INCREF(self);
buf->obj = (PyObject *)self;
buf->buf = self->x->get_data();
buf->len = self->x->get_width() * self->x->get_height() * 4;
buf->len = (Py_ssize_t)self->x->get_width() * (Py_ssize_t)self->x->get_height() * 4;
buf->readonly = 0;
buf->format = (char *)"B";
buf->ndim = 3;
Expand Down Expand Up @@ -531,7 +531,7 @@ int PyRendererAgg_get_buffer(PyRendererAgg *self, Py_buffer *buf, int flags)
Py_INCREF(self);
buf->obj = (PyObject *)self;
buf->buf = self->x->pixBuffer;
buf->len = self->x->get_width() * self->x->get_height() * 4;
buf->len = (Py_ssize_t)self->x->get_width() * (Py_ssize_t)self->x->get_height() * 4;
buf->readonly = 0;
buf->format = (char *)"B";
buf->ndim = 3;
Expand Down
0