#NEWLINE# def save( self , * args , **kwargs ) : #NEWLINE# #INDENT# if self . thumbnail : #NEWLINE# #INDENT# from django.core.files.images import get_image_dimensions #NEWLINE# import django #NEWLINE# if ( django . VERSION [ 1 ] < 2 ) : #NEWLINE# #INDENT# ( width , height ) = get_image_dimensions ( self . thumbnail . file ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( width , height ) = get_image_dimensions ( self . thumbnail . file , close = True ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ( width , height ) = ( None , None ) #NEWLINE# #UNINDENT# self . thumbnail_width = width #NEWLINE# self . thumbnail_height = height #NEWLINE# super ( Category , self ) . save ( * args , ** kwargs )