Left: | ||
Right: |
OLD | NEW |
---|---|
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus build tools, | 3 # This file is part of the Adblock Plus build tools, |
4 # Copyright (C) 2006-2014 Eyeo GmbH | 4 # Copyright (C) 2006-2014 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 | 126 |
127 for step in steps: | 127 for step in steps: |
128 filter, args = re.match(r'([^(]+)(?:\((.*)\))?', step).groups() | 128 filter, args = re.match(r'([^(]+)(?:\((.*)\))?', step).groups() |
129 args = re.split(r'\s*,\s*', args) if args else () | 129 args = re.split(r'\s*,\s*', args) if args else () |
130 image = globals()['filter_' + filter](image, baseDir, *args) | 130 image = globals()['filter_' + filter](image, baseDir, *args) |
131 | 131 |
132 f = StringIO() | 132 f = StringIO() |
133 f.name = filename | 133 f.name = filename |
134 image.save(f) | 134 image.save(f) |
135 files[filename] = f.getvalue() | 135 files[filename] = f.getvalue() |
136 | |
137 def getImageSize(file): | |
138 return Image.open(StringIO(file)).size | |
Wladimir Palant
2014/03/19 12:11:48
I didn't mean to actually put this code into image
saroyanm
2014/03/19 14:54:18
Got it,
moved to packager.
| |
OLD | NEW |