matthewwithanm / pilkit

Utilities and processors built for, and on top of PIL
BSD 3-Clause "New" or "Revised" License
196 stars 54 forks source link

Update utils.py #30

Closed 3x0dv5 closed 6 years ago

3x0dv5 commented 6 years ago

Running on IIS on Windows 2016 kept getting the error UnsupportedOperation Handling the exception seems to handle it. Please take a look.

C:\Sites\pyenv\lib\site-packages\imagekit\specs__init.py in generate options=self.options) ... ▼ Local vars Variable Value closed
False img <PIL.PngImagePlugin.PngImageFile image mode=RGB size=480x317 at 0x1C4BEBBDAC8> self
<toor.imaging.specs.Thumbnail object at 0x000001C4BEBBD908> C:\Sites\pyenv\lib\site-packages\pilkit\utils.py in process_image return img_to_fobj(img, format, autoconvert, **options) ... ▼ Local vars Variable Value ProcessorPipeline
<class 'pilkit.processors.base.ProcessorPipeline'> autoconvert True format
'jpeg' img <PIL.Image.Image image mode=RGBA size=728x481 at 0x1C4BEBBDA90> options {'compress_level': 1, 'optimize': 0, 'progressive': 1, 'quality': 95} original_format 'PNG' processors
[<toor.imaging.specs.ImageResizeProcessor object at 0x000001C4BEBBD780>, <toor.imaging.specs.WatermarkProcessor object at 0x000001C4BEBBD9B0>] C:\Sites\pyenv\lib\site-packages\pilkit\utils.py in img_to_fobj return save_image(img, StringIO(), format, options, autoconvert) ... ▼ Local vars Variable Value autoconvert True format
'jpeg' img <PIL.Image.Image image mode=RGBA size=728x481 at 0x1C4BEBBDA90> options {'compress_level': 1, 'optimize': 0, 'progressive': 1, 'quality': 95} C:\Sites\pyenv\lib\site-packages\pilkit\utils.py in save_image save(wrapper) ... ▼ Local vars Variable Value autoconvert True format
'jpeg' img <PIL.Image.Image image mode=RGB size=728x481 at 0x1C4BEBBDC50> new_maxblock
1050504 old_maxblock
65536 options {'compress_level': 1, 'optimize': 0, 'progressive': 1, 'quality': 95} outfile <_io.BytesIO object at 0x000001C4BEBD7830> save
<function save_image..save at 0x000001C4BEB890D0> save_kwargs {'compress_level': 1, 'optimize': 0, 'progressive': 1, 'quality': 95} wrapper <pilkit.utils.FileWrapper object at 0x000001C4BEBBDA58> C:\Sites\pyenv\lib\site-packages\pilkit\utils.py in save with quiet(): ... ▼ Local vars Variable Value format
'jpeg' fp
<pilkit.utils.FileWrapper object at 0x000001C4BEBBDA58> img <PIL.Image.Image image mode=RGB size=728x481 at 0x1C4BEBBDC50> options {'compress_level': 1, 'optimize': 0, 'progressive': 1, 'quality': 95} C:\Sites\pyenv\lib\site-packages\pilkit\utils.py in
enter__ self.stderr_fd = sys.stderr.fileno() ... ▼ Local vars Variable Value self
<pilkit.utils.quiet object at 0x000001C4BEBBDB38>