diff options
author | Philipp Hörist <forenjunkie@chello.at> | 2017-11-05 20:50:46 +0300 |
---|---|---|
committer | Philipp Hörist <forenjunkie@chello.at> | 2017-11-06 17:43:39 +0300 |
commit | 958197040424d684de78ca25aaccea7acee3d232 (patch) | |
tree | 875a4be8500604a5ee8b5dcf40063af16744d7c2 | |
parent | caefa4ffe927894de6498e3b7600e1e68cf1d264 (diff) |
[preview] Convert MAX_FILE_SIZE to int
-rw-r--r-- | url_image_preview/url_image_preview.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/url_image_preview/url_image_preview.py b/url_image_preview/url_image_preview.py index 42df854..28cf7eb 100644 --- a/url_image_preview/url_image_preview.py +++ b/url_image_preview/url_image_preview.py @@ -392,14 +392,15 @@ class Base(object): # URL is already displayed return # Check if file size is acceptable - if file_size > self.plugin.config['MAX_FILE_SIZE'] or file_size == 0: + max_size = int(self.plugin.config['MAX_FILE_SIZE']) + if file_size > max_size or file_size == 0: log.info("File size (%s) too big or unknown (zero) for URL: '%s'" % (str(file_size), url)) # URL is already displayed return attributes = {'src': url, - 'max_size': self.plugin.config['MAX_FILE_SIZE'], + 'max_size': max_size, 'filepaths': filepaths, 'key': key, 'iv': iv} |