﻿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
13750	"ImageField accessing height or width and then data results in ""I/O operation on closed file"""	ROsborne	nobody	"If you have a simple model with an ImageField, the following code will fail with a ""I/O operation on closed file"":

instance = MyClass.objects.get(...)
w = instance.image.width
h = instance.image.height
original = Image.open(instance.image)

The work around is to reopen the file:

instance = MyClass.objects.get(...)
w = instance.image.width
h = instance.image.height
instance.image.open()
original = Image.open(instance.image)

Note this is different than the issue of the 2nd read() returning empty strings for two reasons:

1. You can not seek(0), the file is closed.
2. Needing to reopen in this case is unexpected.
"		new	File uploads/storage	1.2					Unreviewed	0	0	0	0		
