#!/bin/bash ## Generate html file to list figures with table ## Also generate descriptions for upper index.html ## column: figures filename (without suffix) or text or newrow ## ex. 'c1' 'c2' 'c3' tr <- text row, tr means end of row ## fig1 fig2 fig3 tr <- 3 figures ## fig4 fig5 fig6 tr <- 3 figures ## 'title2' tr <- the row with text only ## fig6 fig7 tr ## fig8 fig9 fig10 tr <- 2 and 3 figures at this and next row fig2png () { ## if text is a file, return .png name. if not, return text i=$1 ii=$i if [ -f "${i}.ps" ] ; then ## ps2png convert -density 300 "${i}.ps" ${i}.png if [ $? != 0 ];then MAGICK_THREAD_LIMIT=1 convert -density 300 "${i}.ps" ${i}.png fi gzip -f "${i}.ps" convert ${i}.png -fuzz 1% -trim +repage tmp-${i}-${pid}.png mv tmp-${i}-${pid}.png ${i}.png fi if [ -f "${i}.png" ] ; then ## trim white edge and make thumbnail ## thumbnail test "${i}.png" -nt "${i}_thumb.png" && convert -thumbnail 300 "${i}.png" "${i}_thumb.png" ii="" fi if [ -f "${i}" ] ; then ## other files: make thumbnail #convert ${i}.png -fuzz 1% -trim +repage tmp-${i}-${pid}.png #mv tmp-${i}-${pid}.png ${i}.png ## thumbnail test "${i}.png" -nt "${i}_thumb.png" && convert -thumbnail 300 "${i}" "${i%.*}_thumb.png" ii="" fi test -f "$thumb" || thumb="${i%.*}_thumb.png" echo -n "$ii" } cd figs/ # parameters htmlfn="index_reana.html" title="SM vs NI reanalysis (OLD code version)" comment=$'\n' comment+='

Notes

' comment+='