title: Proper way to add an image file inside a PDF document generated with Reportlab on AppEngine Python
body: <p>I'm trying to generate a PDF report using reportlab on App Engine Python.</p>
  
  <p>But I don't know how to attach an image properly.</p>
  
  <p>The image is static.</p>
  
  <p>This is the directory tree of my project.</p>
  
  <p><img src="https://i.stack.imgur.com/FnJdJ.png" alt="enter image description here"></p>
  
  <p>and this is what I do (inside '<strong>chipas.py</strong>') to get the image:</p>
  
  <pre><code>im = Image('../static/logo.png',1*inch, 1*inch)
  story.append(im)
  ...
  </code></pre>
  
  <p>The stack trace I get:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):   File
    "C:\Users\Lucas\Dropbox\Desarrollo\Python\windows\AppEngine\google\appengine\ext\webapp_webapp25.py",
    line 701, in <strong>call</strong>
        handler.get(*groups)   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\chipas.py",
    line 1035, in get
        doc.build(story)   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\doctemplate.py",
    line 1117, in build
        BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)   File
    "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\doctemplate.py",
    line 880, in build
        self.handle_flowable(flowables)   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\doctemplate.py",
    line 763, in handle_flowable
        if frame.add(f, canv, trySplit=self.allowSplitting):   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\frames.py",
    line 159, in _add
        w, h = flowable.wrap(aW, h)   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\flowables.py",
    line 408, in wrap
        return self.drawWidth, self.drawHeight   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\flowables.py",
    line 402, in <strong>getattr</strong>
        self._setup_inner()   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\flowables.py",
    line 368, in _setup_inner
        img = self._img   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\platypus\flowables.py",
    line 398, in <strong>getattr</strong>
        self._img = ImageReader(self._file)   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\lib\utils.py",
    line 541, in <strong>init</strong>
        if _isPILImage(fileName):   File "C:\Users\Lucas\Dropbox\Desarrollo\workspace\python\chipas-windows\src\reportlab\lib\utils.py",
    line 521, in _isPILImage
        return isinstance(im,Image.Image) AttributeError: 'NoneType' object has no attribute 'Image' INFO     2012-02-29 19:54:37,276
    dev_appserver.py:4247] "GET
    /pdf?pedido=ahVkZXZ-Y2hpcGFzLWludGhlY2xvdWRyLwsSBlBlZGlkbyIjMjAxMi0wMi0yOSAxOTo1NDoxOHRlc3RAZXhhbXBsZS5jb20M
    HTTP/1.1" 500 -</p>
  </blockquote>
  
  <p>What's the proper way to add an image file inside a pdf document generated with reportlab?
  Many thanks in advance!</p>