Skip to content

Commit

Permalink
Merge pull request #9 from crass/fix-#2
Browse files Browse the repository at this point in the history
Fix NaN values in MCU when clicking "Set DC" while no value is in custom input box
  • Loading branch information
albmac authored Apr 4, 2024
2 parents f1c6c13 + 08593c6 commit ba17edb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion JPEGVisualRepairTool.html
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,10 @@ <H2 style="display:inline">JPEG visual repair tool v1.3 (Oct '23)</H2> by Albert
undoList.push({action: "DC", position: selectedMCU.i, cell: structuredClone(MCUarray[selectedMCU.i])});
if(value==0){
var newDC=parseInt(document.getElementById("dcVal").value);
if(document.getElementById("layer").value=="Y"){
if (Number.isNaN(parseInt(newDC))) {
; // no value or invalid value
}
else if(document.getElementById("layer").value=="Y"){
MCUarray[selectedMCU.i].blocks[0].coeff[0]=newDC;
}
else if(document.getElementById("layer").value=="C1"){
Expand Down

0 comments on commit ba17edb

Please sign in to comment.