def _build_html_image(img, id, div_klass, img_klass, caption=None, show=True):
 html = []
 add_style = (u'' if show else u'style="display: none"')
 html.append((u'<li class="%s" id="%s" %s>' % (div_klass, id, add_style)))
 html.append(u'<div class="thumbnail">')
 html.append((u'<img class="%s" alt="" style="width:90%%;" src="data:image/png;base64,%s">' % (img_klass, img)))
 html.append(u'</div>')
 if caption:
  html.append((u'<h4>%s</h4>' % caption))
 html.append(u'</li>')
 return u'\n'.join(html)

def _build_html_image ( img , id , div_klass , img_klass , caption = None , show = True ) : html = [ ] add_style = ( u'' if show else u'style="display: none"' ) html . append ( ( u'<li class="%s" id="%s" %s>' % ( div_klass , id , add_style ) ) ) html . append ( u'<div class="thumbnail">' ) html . append ( ( u'<img class="%s" alt="" style="width:90%%;" src="data:image/png;base64,%s">' % ( img_klass , img ) ) ) html . append ( u'</div>' ) if caption : html . append ( ( u'<h4>%s</h4>' % caption ) ) html . append ( u'</li>' ) return u'\n' . join ( html )
build a html image from a slice array .