def computeComprRate(meta, compr_size):
 if ((not meta.has('width')) or (not meta.has('height')) or (not meta.has('bits_per_pixel'))):
  return
 if (not compr_size):
  return
 orig_size = ((meta.get('width') * meta.get('height')) * meta.get('bits_per_pixel'))
 meta.compr_rate = (float(orig_size) / compr_size)

def computeComprRate ( meta , compr_size ) : if ( ( not meta . has ( 'width' ) ) or ( not meta . has ( 'height' ) ) or ( not meta . has ( 'bits_per_pixel' ) ) ) : return if ( not compr_size ) : return orig_size = ( ( meta . get ( 'width' ) * meta . get ( 'height' ) ) * meta . get ( 'bits_per_pixel' ) ) meta . compr_rate = ( float ( orig_size ) / compr_size )
compute image compression rate .