Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images without all the options #1

Open
sanguinariojoe opened this issue Sep 17, 2014 · 1 comment
Open

Images without all the options #1

sanguinariojoe opened this issue Sep 17, 2014 · 1 comment

Comments

@sanguinariojoe
Copy link

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'])
@ohadcn
Copy link
Owner

ohadcn commented Sep 17, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants