summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-08-08 20:59:02 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-08-08 20:59:02 +0000
commit7899568e01fc9c68afe995fa71de915dd9fcdd76 (patch)
tree35f1e999a9a48fe24790f00c2335e558a53fc718 /django/utils
parentc49eac7d4f64c374d19aa81f2c813a4b20e4cad7 (diff)
File storage refactoring, adding far more flexibility to Django's file handling. The new files.txt document has details of the new features.
This is a backwards-incompatible change; consult BackwardsIncompatibleChanges for details. Fixes #3567, #3621, #4345, #5361, #5655, #7415. Many thanks to Marty Alchin who did the vast majority of this work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/images.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/django/utils/images.py b/django/utils/images.py
index 122c6ae233..c6cc37cf9a 100644
--- a/django/utils/images.py
+++ b/django/utils/images.py
@@ -1,22 +1,5 @@
-"""
-Utility functions for handling images.
+import warnings
-Requires PIL, as you might imagine.
-"""
+from django.core.files.images import get_image_dimensions
-import ImageFile
-
-def get_image_dimensions(path):
- """Returns the (width, height) of an image at a given path."""
- p = ImageFile.Parser()
- fp = open(path, 'rb')
- while 1:
- data = fp.read(1024)
- if not data:
- break
- p.feed(data)
- if p.image:
- return p.image.size
- break
- fp.close()
- return None
+warnings.warn("django.utils.images has been moved to django.core.files.images.", DeprecationWarning)