Thank Russ, I have opened a ticket : http://code.djangoproject.com/ticket/15817
Unfortunately, I can't find a easy way to solve the problem because the solution is somewhere in the ImageFileDesciptor.__set__() method which is a dangerous area ! Cordialement, Stanislas. On Apr 12, 2:03 pm, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Mon, Apr 11, 2011 at 8:16 PM, stan <stanislas.gue...@gmail.com> wrote: > > The main purpose of the height_field and width_field attributes is to > > give a performance boost in some situations, > > these fields acting as a cache on the dimensions of the image. > ... > > The simple fact of posting an unchanged form of a person cause the > > opening with the PIL of *all* the unmodified images to fill-in the > > dimension_fields of the virtual models in the form validation process. > > > This looks like an unecessary overhead and maybe something more lazy > > could be more appropriate. I am sorry for not coming with a patch - I > > do not get the whole picture of the core - but an expert point of > > views is welcome here :-) > > It sounds to me like you could be right; this strikes me as an > oversight, rather than anything deliberate. It's worth opening a > ticket so that this isn't forgotten. > > Although you're seeing the problem with FormSets, I suspect you'll > find that it exists with normal forms, too -- it just isn't as > pronounced because a formset multiplies the scope of the problem. > > Looking at the code in question, the reference to #11084 is a good > starting point for further analysis. It describes the exact problem > that you're talking about under a slightly different context. I > suspect you'll find that the fix to your problem will be in a similar > mould -- i.e., find a set of conditions that accurately identifies > when a form is being instantiated with existing file data, and ensure > that the dimension update doesn't happen under those conditions. > > Yours, > Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.