comparison sat/plugins/plugin_xep_0264.py @ 3346:4f1fcee83d36

plugin XEP-0264: only log "fix orientation" when the option is used
author Goffi <goffi@goffi.org>
date Tue, 25 Aug 2020 08:52:46 +0200
parents 7b47f48d31f3
children be6d91572633
comparison
equal deleted inserted replaced
3345:3dc8835d96cc 3346:4f1fcee83d36
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 2
3 3 # SàT plugin for managing xep-0264
4 # SAT plugin for managing xep-0264
5 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org) 4 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)
6 # Copyright (C) 2014 Emmanuel Gil Peyrot (linkmauve@linkmauve.fr) 5 # Copyright (C) 2014 Emmanuel Gil Peyrot (linkmauve@linkmauve.fr)
7 6
8 # This program is free software: you can redistribute it and/or modify 7 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Affero General Public License as published by 8 # it under the terms of the GNU Affero General Public License as published by
161 160
162 with self.host.common_cache.cacheData( 161 with self.host.common_cache.cacheData(
163 PLUGIN_INFO[C.PI_IMPORT_NAME], uid, MIME_TYPE, max_age 162 PLUGIN_INFO[C.PI_IMPORT_NAME], uid, MIME_TYPE, max_age
164 ) as f: 163 ) as f:
165 img.save(f, SAVE_FORMAT) 164 img.save(f, SAVE_FORMAT)
166 log.debug(f"fixed orientation for {f.name}") 165 if fix_orientation:
166 log.debug(f"fixed orientation for {f.name}")
167 167
168 return img.size, uid 168 return img.size, uid
169 169
170 def generateThumbnail( 170 def generateThumbnail(
171 self, source_path, size=None, max_age=None, image_uid=None, fix_orientation=True): 171 self, source_path, size=None, max_age=None, image_uid=None, fix_orientation=True):