Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

        def makeRawImage(filename,IMG=None):
    import zlib
    img = ImageReader(filename)
    if IMG is not None: IMG.append(img)

    imgwidth, imgheight = img.getSize()
    raw = img.getRGBData()

    code = []
    append = code.append
    # this describes what is in the image itself
    append('BI')
    append('/W %s /H %s /BPC 8 /CS /%s /F [/Fl]' % (imgwidth, imgheight,_mode2cs[img.mode]))
    append('ID')
    #use a flate filter
    assert len(raw) == imgwidth * imgheight*_mode2bpp[img.mode], "Wrong amount of data for image"
    compressed = zlib.compress(raw)   #this bit is very fast...

    #append in blocks of 60 characters
    _chunker(compressed,code)

    append('EI')
    return code
        


src/d/j/django-admin-report-HEAD/example/lib/reportlab/pdfbase/pdfdoc.py   django-admin-report(Download)
    def loadImageFromRaw(self,source):
        IMG=[]
        imagedata = pdfutils.makeRawImage(source,IMG=IMG)
        words = string.split(imagedata[1])
        self.width, self.height = map(string.atoi,(words[1],words[3]))

src/m/w/mwlib.ext-0.13.2/upstream-src/src/reportlab/pdfbase/pdfdoc.py   mwlib.ext(Download)
    def loadImageFromRaw(self,source):
        IMG=[]
        imagedata = pdfutils.makeRawImage(source,IMG=IMG)
        words = string.split(imagedata[1])
        self.width, self.height = map(string.atoi,(words[1],words[3]))

src/r/e/ReportLab-HEAD/src/reportlab/pdfbase/pdfdoc.py   ReportLab(Download)
    def loadImageFromRaw(self,source):
        IMG=[]
        imagedata = pdfutils.makeRawImage(source,IMG=IMG)
        words = string.split(imagedata[1])
        self.width, self.height = map(string.atoi,(words[1],words[3]))

src/i/e/iellos-HEAD/lib/reportlab/pdfbase/pdfdoc.py   iellos(Download)
    def loadImageFromRaw(self,source):
        IMG=[]
        imagedata = pdfutils.makeRawImage(source,IMG=IMG)
        words = string.split(imagedata[1])
        self.width, self.height = map(string.atoi,(words[1],words[3]))

src/m/a/mangareader-to-ebook-HEAD/reportlab/pdfbase/pdfdoc.py   mangareader-to-ebook(Download)
    def loadImageFromRaw(self,source):
        IMG=[]
        imagedata = pdfutils.makeRawImage(source,IMG=IMG)
        words = string.split(imagedata[1])
        self.width, self.height = map(string.atoi,(words[1],words[3]))

src/r/e/reportlab-3.1.8/src/reportlab/pdfbase/pdfdoc.py   reportlab(Download)
    def loadImageFromRaw(self,source):
        IMG=[]
        imagedata = pdfutils.makeRawImage(source,IMG=IMG)
        words = imagedata[1].split()
        self.width = int(words[1])