Commit Graph

6 Commits

Author SHA1 Message Date
Luke Plant 76249c3964 Fixed #11158 - get_image_dimensions very slow/incorrect after 1 call
Thanks to kua for the report, and to kua, SmileyChris and SAn for the patch



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13715 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-10 18:45:25 +00:00
Jacob Kaplan-Moss 7578981626 Fixed #6054: work around PIL's installation brokeness by detecting either of the two ways it can end up being installed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12429 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-14 18:28:28 +00:00
Jacob Kaplan-Moss 2b0903b2c4 Fixed #10404: ImageField height_field and width_field options no longer depend on putting the image field after the height/width fields as they did after r9766.
This bug actually exposed a related handful of inconsistancies in the underlying file handling and wraping, so a few related changes are in here as well:

    * Dimensions are also now calculated the moment the image is assigned to the field instead of upon save.
    * The base `File` object now when possible delegates its closed attribute down to the os-level file it wrapps.
    * In-memory files' `close()` now is a no-op. Without this certain APIs that should be able to handle in-memory files were failing.
    * Accessing `FieldFile.closed` used to open the file. That's silly, and it doesn't any more.
    * Some over-eager error handling was squishing some errors that would normally be raised. One unit test was incorrectly depending on this behavior, so the test was removed.

Thanks to Armin Ronacher for much of this work.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10737 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-11 09:57:19 +00:00
Jacob Kaplan-Moss a7faf6424a Fixed #8817: get_image_dimensions correctly closes the files it opens, and leaves open the ones it doesn't. Thanks, mitsuhiko.
While I was at it, I converted the file_storage doctests to unit tests.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10707 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 10:56:51 +00:00
Jacob Kaplan-Moss 6f6024751c Don't import PIL until needed so that systems without PIL don't barf.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 21:57:25 +00:00
Jacob Kaplan-Moss 7899568e01 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
2008-08-08 20:59:02 +00:00