#NEWLINE# def serialize_image_file( image_file ) : #NEWLINE# #INDENT# if ( data . size is None ) : #NEWLINE# #INDENT# raise ThumbnailError ( 'Trying to serialize an ``ImageFile`` with a ``None`` size.' ) #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'name' : image_file . name , #NEWLINE# 'storage' : image_file . serialize_storage ( ) , #NEWLINE# 'size' : image_file . size , #NEWLINE# #UNINDENT# } #NEWLINE# return json . dumps ( data )