snbopen icon indicating copy to clipboard operation
snbopen copied to clipboard

Images without all the options

Open sanguinariojoe opened this issue 10 years ago • 1 comments

Sometimes the images inside the SNB files does not contains some fields (like bottom), I suggest to replace the class imagePoss by:

class imagePoss:
    def __init__(self, style):
        self.style = style
        self.options = {'left':0.0,
                        'bottom':0.0,
                        'width':595.27,
                        'height':841.89}
        self.compute()

    def compute(self):
        fields = self.style.split(';')
        for f in fields:
            name, value = f.split(':')
            if name in self.options.keys():
                self.options[name] = float(value.replace('pt', ''))

Such that to insert the image the following command can be used:

        canvas.drawInlineImage(img,
                               style.options['left'],
                               style.options['bottom'],
                               style.options['width'],
                               style.options['height'])

sanguinariojoe avatar Sep 17 '14 14:09 sanguinariojoe

i do no longer have s-note (this was one night project, when a friend gave me his and i needed the files) i can give you write access to the repo so you can fix it.

ohadcn avatar Sep 17 '14 17:09 ohadcn