﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33965	Improve docs for PIL validation of ImageField	Tim Schilling	Alex Morega	"The current docs indicate:

    You may also provide any file-like object (e.g., StringIO or BytesIO) as a file handle. If you’re uploading to an ImageField, the object needs a name attribute that passes the validate_image_file_extension validator. For example:
    {{{
    from io import BytesIO
    img = BytesIO(b'mybinarydata')
    img.name = 'myimage.jpg'
    }}}

However, this results in the `invalid_image` error for `ImageField` when PIL is installed. Some possible code to pass this validation is:

{{{
img = BytesIO()
Image.new(""RGB"", (1, 1), ""#FF0000"").save(img, format='PNG')
img.name = 'myimage.png'
img.seek(0)
}}}

This creates the binary data that's actually an image which passes the underlying `PIL.Image.verify()` call."	Cleanup/optimization	closed	Documentation	4.1	Normal	fixed	documentation imagefield		Ready for checkin	1	0	0	0	0	0
