Задать вопрос

Тел: +7 965 3737 888

474

Просмотров

1

Ответов

ImageURLField for forms

A URL field specifically for images, which can validate details about the filesize, dimensions and format of an image at a given URL, without having to read the entire image into memory.

Requires Python Imaging Library.

4th October, 2008 - updated for 1.0 compatibility.

Вопрос полезен? Да0/Нет0
file_5101.py(5.6Кб)
None

Ответы (1):

Ответsvetlyak:04.09.2007
Ответ полезен? Да0/Нет0

Cool, I'll use this code in my photoblog! Did you read all image by chunks or header only, using data = file.read(1024) and p.feed(data)? Why do not call file.read() instead?

And, probably, you dont need try: except: statement around of all these ifs, you need this around _get_image_details call, only, isnt it?