photopea / UTIF.js

Fast and advanced TIFF decoder
MIT License
426 stars 87 forks source link

UTIF.js error fix #98

Closed programnara closed 3 years ago

programnara commented 3 years ago
[UTIF.js] fix :
line 1053 :
                if(false) {}
                else if(bps==1) mi=(data[dof+(x>>>3)]>>>(7-(x&7)))&1;
                else if(bps==4) mi=(data[dof+(x>>>1)]>>>(4-4*(x&1)))&15;
                else if(bps==8) mi= data[dof+x*smpls]; 

add a line : else if(bps==2) mi=(data[dof+(x>>>2)]>>>(6-2*(x&3)))&3; then it can show this tif : https://www.eso.org/public/archives/images/original/eso9616a.tif
for example [test.html]: <script type="text/javascript" src="UTIF.js"></script> <body onload="UTIF.replaceIMG()"> <img src="https://www.eso.org/public/archives/images/original/eso9616a.tif">
photopea commented 3 years ago

Thanks, it is fixed now (in Photopea.com and here at Github). :)