Error in draw.rectangle([x1, y1, x2, y2], fill=“Black”) when drawing rectangle with PIL for high dimension images
问题 I'm getting Error in draw.rectangle([x1, y1, x2, y2], fill="Black") when drawing rectangle with PIL python library for high dimension png file(770x1024). But it works for medium size images. img = Image.open(BytesIO(file_byte_string)) width, height = img.size . . if(doc.pages): page = doc.pages[0] . . for field in page.form.fields: if(field.key and field.value): . . x1 = field.value.geometry.boundingBox.left*width y1 = field.value.geometry.boundingBox.top*height-2 x2 = x1 + (field.value