diff --git a/django/core/files/images.py b/django/core/files/images.py
index 55008b5..ab9a398 100644
--- a/django/core/files/images.py
+++ b/django/core/files/images.py
@@ -23,12 +23,10 @@ class ImageFile(File):
         if not hasattr(self, '_dimensions_cache'):
             close = self.closed
             self.open()
-            self._dimensions_cache = get_image_dimensions(self)
-            if close:
-                self.close()
+            self._dimensions_cache = get_image_dimensions(self, close=close)
         return self._dimensions_cache
 
-def get_image_dimensions(file_or_path):
+def get_image_dimensions(file_or_path, close=False):
     """Returns the (width, height) of an image, given an open file or a path."""
     # Try to import PIL in either of the two ways it can end up installed.
     try:
@@ -37,9 +35,10 @@ def get_image_dimensions(file_or_path):
         import ImageFile as PILImageFile
         
     p = PILImageFile.Parser()
-    close = False
     if hasattr(file_or_path, 'read'):
         file = file_or_path
+        file_pos = file.tell()
+        file.seek(0)
     else:
         file = open(file_or_path, 'rb')
         close = True
@@ -55,3 +54,5 @@ def get_image_dimensions(file_or_path):
     finally:
         if close:
             file.close()
+        else:
+            file.seek(file_pos)
