All pastes #1455652 Raw Edit

Mine

public text v1 · immutable
#1455652 ·published 2009-06-10 18:24 UTC
rendered paste body
    def sizes(self):
        """return image sizes"""
        sizes = { 'default': self.default_size,
                  'thumbnail': self.thumbnail }
        for option, value in self.env.config.options('ticket-image'):
            if option.startswith('size.'):
                sizes[option.split('.', 1)[-1]] = value

        for size in sizes:
            try:
                dimension = [ i.strip() and int(i) or None for i in sizes[size].split('x') ]
            except ValueError:
                sizes.pop(size)
                continue
            sizes[size] = dimension
        return sizes