How to embed a TIFF image in an HTML file
조회 수: 13 (최근 30일)
이전 댓글 표시
The following code embeds a TIFF image in a HTML page and opens that page in MATLAB browser. The image does not show up and the fall-through text does not show up either, although the type "image/tiff" is registered to be handled by AlternaTIFF v2.0.6 (at my place) and the page shows the image in Chrome no questions asked (I allowed AlternaTIFF wholesale). What am I doing wrong?
logo print -dtiff logo a_f = fopen ('logo.html', 'w'); a_f_c = onCleanup (@ () fclose (a_f)); close fprintf... (a_f, ... [ '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" >', ... '<META HTTP-EQUIV=CONTENT-TYPE CONTENT="TEXT/HTML; CHARSET=ISO-8859-1" ><TITLE >Logo</TITLE >', ... '<P ><OBJECT HEIGHT=901 WIDTH=1201 TYPE="IMAGE/TIFF" DATA="logo.tif" ><PARAM NAME="TOOLBAR" VALUE="off" >No logo</OBJECT >', ... '<SCRIPT TYPE="APPLICATION/JAVASCRIPT" ><!-- ', 10, ... 'var an_ix = 0, l_mt = navigator .mimeTypes, a_mt_c = l_mt .length; ', ... 'for (; an_ix < a_mt_c; ++ an_ix)', ... '{ ', ... 'var a_mt = l_mt [an_ix]; if (a_mt .type == "image/tiff") { var a_pl = a_mt .enabledPlugin; document .writeln ("<DL >"); ', ... 'for (var a_prop in a_pl) document .writeln ("<DT >" + a_prop + "<DD >" + a_pl [a_prop]); document .writeln ("<\\/DL >"); }}', ... '//--></SCRIPT >' ]); open logo.html
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!