﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1026	Set width and height failed when saving a upload image through the function 'save_*_file'	leo@…	Adrian Holovaty	"An exception is thrown out when you use the function 'save_*_file' to save an upload image file.

----

Traceback (most recent call last):
  File ""<stdin>"", line 1, in ?
  File ""/usr/lib/python2.3/site-packages/django/utils/functional.py"", lin e 3, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwar gs.items()))
  File ""/usr/lib/python2.3/site-packages/django/core/meta/__init__.py"", l ine 1302, in method_save_file
    setattr(self, field.width_field, width)
TypeError: attribute name must be string

----

Fix patch:
--- django/core/meta/__init__.py        (revision 1566)
+++ django/core/meta/__init__.py        (working copy)
@@ -1303,9 +1303,9 @@
         from django.utils.images import get_image_dimensions
         width, height = get_image_dimensions(getattr(self, 'get_%s_filename' % field.name)())
         if field.width_field:
-            setattr(self, field.width_field, width)
+            setattr(self, '%s.width_field' % field, width)
         if field.height_field:
-            setattr(self, field.height_field, height)
+            setattr(self, '%s.height_field' % field, height)"	defect	closed	Core (Other)		normal	wontfix			Unreviewed	0	0	0	0	0	0
