范围

本页面的文档在 Pillow 落实各项基本的大小限制。

内部限制

  • 图片大小不能为负。这些在``Storage.c``和``Image.py``检查两

  • 图像尺寸可以是0(尽管未在3.4)

  • 最大像素尺寸由在图像标题中的大小限制为INT32,或2 ^ 31。

  • 各个分配被限制为2GB的``Storage.c``

  • 2GB的分配卖出期权的上限或者2 ^ 31的为“L”或2 ^ 29“RGB”的图像的XSIZE

  • Individual memory mapped segments are limited to 2GB in map.c based on the overflow checks. This requires that any memory mapped image is smaller than 2GB, as calculated by y*stride (so 2Gpx for ‘L’ images, and .5Gpx for ‘RGB’

  • Any call to internal python size functions for buffers or strings are currently returned as int32, not py_ssize_t. This limits the maximum buffer to 2GB for operations like frombytes and frombuffer.

  • 这还限制缓冲区的大小使用解码器转换。 (decode.c:127)

格式大小限制