Python PIL.Image.register_extension() Examples

The following are 8 code examples of PIL.Image.register_extension(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PIL.Image , or try the search function .
Example #1
Source File: SpiderImagePlugin.py    From teleport with Apache License 2.0 5 votes vote down vote up
def _save_spider(im, fp, filename):
    # get the filename extension and register it with Image
    ext = os.path.splitext(filename)[1]
    Image.register_extension(SpiderImageFile.format, ext)
    _save(im, fp, filename)

# -------------------------------------------------------------------- 
Example #2
Source File: SpiderImagePlugin.py    From teleport with Apache License 2.0 5 votes vote down vote up
def _save_spider(im, fp, filename):
    # get the filename extension and register it with Image
    ext = os.path.splitext(filename)[1]
    Image.register_extension(SpiderImageFile.format, ext)
    _save(im, fp, filename)


# -------------------------------------------------------------------- 
Example #3
Source File: SpiderImagePlugin.py    From teleport with Apache License 2.0 5 votes vote down vote up
def _save_spider(im, fp, filename):
    # get the filename extension and register it with Image
    ext = os.path.splitext(filename)[1]
    Image.register_extension(SpiderImageFile.format, ext)
    _save(im, fp, filename)


# -------------------------------------------------------------------- 
Example #4
Source File: SpiderImagePlugin.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _save_spider(im, fp, filename):
    # get the filename extension and register it with Image
    ext = os.path.splitext(filename)[1]
    Image.register_extension(SpiderImageFile.format, ext)
    _save(im, fp, filename)

# -------------------------------------------------------------------- 
Example #5
Source File: test_image.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_register_extensions(self):
        test_format = "a"
        exts = ["b", "c"]
        for ext in exts:
            Image.register_extension(test_format, ext)
        ext_individual = Image.EXTENSION.copy()
        for ext in exts:
            del Image.EXTENSION[ext]

        Image.register_extensions(test_format, exts)
        ext_multiple = Image.EXTENSION.copy()
        for ext in exts:
            del Image.EXTENSION[ext]

        self.assertEqual(ext_individual, ext_multiple) 
Example #6
Source File: SpiderImagePlugin.py    From FODI with GNU General Public License v3.0 5 votes vote down vote up
def _save_spider(im, fp, filename):
    # get the filename extension and register it with Image
    ext = os.path.splitext(filename)[1]
    Image.register_extension(SpiderImageFile.format, ext)
    _save(im, fp, filename)


# -------------------------------------------------------------------- 
Example #7
Source File: SpiderImagePlugin.py    From lambda-text-extractor with Apache License 2.0 5 votes vote down vote up
def _save_spider(im, fp, filename):
    # get the filename extension and register it with Image
    ext = os.path.splitext(filename)[1]
    Image.register_extension(SpiderImageFile.format, ext)
    _save(im, fp, filename)

# -------------------------------------------------------------------- 
Example #8
Source File: SpiderImagePlugin.py    From lambda-text-extractor with Apache License 2.0 5 votes vote down vote up
def _save_spider(im, fp, filename):
    # get the filename extension and register it with Image
    ext = os.path.splitext(filename)[1]
    Image.register_extension(SpiderImageFile.format, ext)
    _save(im, fp, filename)

# --------------------------------------------------------------------