Surface.create_for_data: Not Implemented yet.

Bug #1330228 reported by David Klasinc
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
py3cairo (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Kazam Screen caster, written in Python3, is using Cairo for doing graphics. Now, I've run into this:

File "../kazam/frontend/window_countdown.py", line 181, in createDropShadow
    surface = cairo.ImageSurface.create_for_data(data, format, width, height)
NotImplementedError: Surface.create_for_data: Not Implemented yet.

It appears that Surface.create_for_data isn't implemented. After inspecting the weird code in the original tar.gz I confirmed this:

static PyObject *
image_surface_create_for_data (PyTypeObject *type, PyObject *args) {
  cairo_surface_t *surface;
  cairo_format_t format;
  unsigned char *buffer;
  int width, height, stride = -1, res;
  Py_ssize_t buffer_len;
  PyObject *obj;

  // buffer function disabled
  PyErr_SetString(PyExc_NotImplementedError, "Surface.create_for_data: Not Implemented yet.");
  return NULL; /* By BigW: Everything past here is dead code */

  if (!PyArg_ParseTuple(args, "Oiii|i:Surface.create_for_data",
                        &obj, &format, &width, &height, &stride))
    return NULL;

However, after checking couple of other repositories with pycairo, create_for_data() function is different, without the weird return call.

I've checked:

http://cgit.freedesktop.org/pycairo/
git://git.cairographics.org/git/pycairo

Can this patch from 2011 be included in Ubuntu?
http://lists.cairographics.org/archives/cairo/2011-December/022563.html

And why am I the first one running into this? :)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in py3cairo (Ubuntu):
status: New → Confirmed
Revision history for this message
Richard Clay (richoeq) wrote :

New to installing patches. How do I update the version of pycairo on my computer?

I have git://git.cairographics.org/git/pycairo cloned to my local git repository.

Revision history for this message
Muelli (ubuntu-bugs-auftrags-killer) wrote :
Revision history for this message
Richard Clay (richoeq) wrote :

Thank you Muelli, that worked.

Revision history for this message
Muelli (ubuntu-bugs-auftrags-killer) wrote :
Revision history for this message
Christoph Reiter (lazka) wrote :

This is fixed in 1.15.4-2

Changed in py3cairo (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.