Hi,

  see below

regards 
   Uwe
Am Donnerstag, den 13.08.2009, 10:38 +0100 schrieb Chris Arthur:

> stride=cairo.ImageSurface.format_stride_for_width (cairo.FORMAT_ARGB32,
> AttributeError:type object 'cairo.ImageSurface' has no attribute 
> 'format_stride_for_width'
> 
> I have tried this on two boxes running Ubuntu 9.04 and one using Fedora 
> 8, and they all give the same error

I was a little bit too optimistic when developing the code with pycairo
1.8.6 .

>  format_stride_for_width is definately in Ciaro (currently v 1.8.8) 
> <http://cairographics.org/documentation/cairomm/reference/classCairo_1_1ImageSurface.html>
> 
> Oddly Ubuntu 9.04 uses the libcairo2 version is 1.8.6-1

libcairo 1.8.6 is a sufficient version but pycairo 1.4.12 not (installed
with ubuntu 9.04).


> Does anyone have any suggestions?
> 

if you are still interested (and do not want to install pycairo 1.8.6):
Change the lines (cairoCanvas.py around line 40)
        stride = cairo.ImageSurface.format_stride_for_width (
          cairo.FORMAT_ARGB32,
          image.size[0])
        if stride != image.size[0] * 4:
          raise Exception ,"invalid stride"

to (i hope the indentation will be right):

      try:
        stride = cairo.ImageSurface.format_stride_for_width (
          cairo.FORMAT_ARGB32,
          image.size[0])
        if stride != image.size[0] * 4:
          raise Exception ,"invalid stride"
      except AttributeError:
        stride = image.size[0] * 4

> Chris
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Reply via email to