aboutsummaryrefslogtreecommitdiffstats
path: root/env/lib/python3.10/site-packages/PIL/XVThumbImagePlugin.py
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-11-14 16:43:12 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-11-14 16:43:12 +0530
commitd47f8b48935d258f4c5c3e2267911753bebd5214 (patch)
tree3ed04e75bc3fc7c8e4ce618f527565da1df630a1 /env/lib/python3.10/site-packages/PIL/XVThumbImagePlugin.py
parent9468226a9e2e2ab8cdd599f1d8538e860ca86120 (diff)
downloadidcard-d47f8b48935d258f4c5c3e2267911753bebd5214.tar.gz
idcard-d47f8b48935d258f4c5c3e2267911753bebd5214.tar.bz2
idcard-d47f8b48935d258f4c5c3e2267911753bebd5214.zip
id card
Diffstat (limited to 'env/lib/python3.10/site-packages/PIL/XVThumbImagePlugin.py')
-rw-r--r--env/lib/python3.10/site-packages/PIL/XVThumbImagePlugin.py78
1 files changed, 0 insertions, 78 deletions
diff --git a/env/lib/python3.10/site-packages/PIL/XVThumbImagePlugin.py b/env/lib/python3.10/site-packages/PIL/XVThumbImagePlugin.py
deleted file mode 100644
index 4efedb7..0000000
--- a/env/lib/python3.10/site-packages/PIL/XVThumbImagePlugin.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# The Python Imaging Library.
-# $Id$
-#
-# XV Thumbnail file handler by Charles E. "Gene" Cash
-# (gcash@magicnet.net)
-#
-# see xvcolor.c and xvbrowse.c in the sources to John Bradley's XV,
-# available from ftp://ftp.cis.upenn.edu/pub/xv/
-#
-# history:
-# 98-08-15 cec created (b/w only)
-# 98-12-09 cec added color palette
-# 98-12-28 fl added to PIL (with only a few very minor modifications)
-#
-# To do:
-# FIXME: make save work (this requires quantization support)
-#
-
-from . import Image, ImageFile, ImagePalette
-from ._binary import o8
-
-_MAGIC = b"P7 332"
-
-# standard color palette for thumbnails (RGB332)
-PALETTE = b""
-for r in range(8):
- for g in range(8):
- for b in range(4):
- PALETTE = PALETTE + (
- o8((r * 255) // 7) + o8((g * 255) // 7) + o8((b * 255) // 3)
- )
-
-
-def _accept(prefix):
- return prefix[:6] == _MAGIC
-
-
-##
-# Image plugin for XV thumbnail images.
-
-
-class XVThumbImageFile(ImageFile.ImageFile):
-
- format = "XVThumb"
- format_description = "XV thumbnail image"
-
- def _open(self):
-
- # check magic
- if not _accept(self.fp.read(6)):
- raise SyntaxError("not an XV thumbnail file")
-
- # Skip to beginning of next line
- self.fp.readline()
-
- # skip info comments
- while True:
- s = self.fp.readline()
- if not s:
- raise SyntaxError("Unexpected EOF reading XV thumbnail file")
- if s[0] != 35: # ie. when not a comment: '#'
- break
-
- # parse header line (already read)
- s = s.strip().split()
-
- self.mode = "P"
- self._size = int(s[0]), int(s[1])
-
- self.palette = ImagePalette.raw("RGB", PALETTE)
-
- self.tile = [("raw", (0, 0) + self.size, self.fp.tell(), (self.mode, 0, 1))]
-
-
-# --------------------------------------------------------------------
-
-Image.register_open(XVThumbImageFile.format, XVThumbImageFile, _accept)