Skip to content Skip to sidebar Skip to footer

Imagefield Image_width And Image_height Auto Fill For Existing Database?

I have an existing database table with an ImageField that already has a bunch of existing registries. I want to add the image_width and image_height on my model but I need somethin

Solution 1:

Apparently, I've found a solution! It's a weird one, but it works. I set both image_width and image_height to default to 0 and did a standard migration on dev.

Of course, you would suppose all the existing images be set to 0 height and width, but when I try to access these attributes, for example, in their detail view, I get access to the correct height and width values of the original image (an existing image that was saved before I did the migration).

If someone can explain this I'd be grateful.

Post a Comment for "Imagefield Image_width And Image_height Auto Fill For Existing Database?"