Commits

Mike Orr committed cebd83f

Bugfix in ``get_dimensions_pil``.

Comments (0)

Files changed (2)

 * webhelpers.html.tools:
   - Fix HTML overescaping and underescaping in auto_link().  Patch by Marius
     Gedminas.
+* webhelpers.media:
+  - Bugfix in ``get_dimensions_pil``.
 * webhelpers.paginate:
   - Change for SQLAlchemy 0.6. (bug #11)
 * webhelpers.pylonslib:

webhelpers/media.py

     """Get an image's size using the Python Imaging Library (PIL)
 
     Returns ``(width, height)`` as two integers, or ``default`` if the size
-    could not be ascertained.  Failuer usually means the file does not exist
+    could not be ascertained.  Failure usually means the file does not exist
     or is not in a format recognized by PIL.
 
     Depends on the Python Imaging Library (http://pypi.python.org/pypi/PIL).
     """
     import Image
     try:
-        im = Image(path)
+        im = Image.open(path)
     except Exception:
         return default
     return im.size
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.