#NEWLINE# def convert( self , * args , **kwargs ) : #NEWLINE# #INDENT# super ( Python , self ) . convert ( * args , ** kwargs ) #NEWLINE# if ( ( self . mime_type == 'application/pdf' ) and pdftoppm ) : #NEWLINE# #INDENT# ( new_file_object , input_filepath ) = tempfile . mkstemp ( ) #NEWLINE# self . file_object . seek ( 0 ) #NEWLINE# os . write ( new_file_object , self . file_object . read ( ) ) #NEWLINE# self . file_object . seek ( 0 ) #NEWLINE# os . close ( kwargs ) #NEWLINE# image_buffer = io . BytesIO ( ) #NEWLINE# try : #NEWLINE# #INDENT# pdftoppm ( input_filepath , f = ( self . page_number + 1 ) , l = ( self . page_number + 1 ) , _out = image_buffer ) #NEWLINE# image_buffer . seek ( 0 ) #NEWLINE# return Image . open ( image_buffer ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# fs_cleanup ( input_filepath )