(path)
| 177 | |
| 178 | |
| 179 | def pil_loader(path): |
| 180 | # open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pillow/issues/835) |
| 181 | if isinstance(path, bytes): |
| 182 | img = Image.open(io.BytesIO(path)) |
| 183 | elif is_zip_path(path): |
| 184 | data = ZipReader.read(path) |
| 185 | img = Image.open(io.BytesIO(data)) |
| 186 | else: |
| 187 | with open(path, 'rb') as f: |
| 188 | img = Image.open(f) |
| 189 | return img.convert('RGB') |
| 190 | |
| 191 | |
| 192 | def accimage_loader(path): |
no test coverage detected