Skip to content

Commit b592e77

Browse files
committed
fixed bug with set/getInt8 methods
1 parent 3de142f commit b592e77

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/decoder.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,28 +606,31 @@ jpeg.lossless.Decoder.prototype.output = function (PRED) {
606606
};
607607

608608

609+
609610
jpeg.lossless.Decoder.prototype.setValue16 = function (index, val) {
610611
this.outputData.setInt16(index * 2, val, true);
611612
};
612613

613614

615+
614616
jpeg.lossless.Decoder.prototype.getValue16 = function (index) {
615617
return this.outputData.getInt16(index * 2, true);
616618
};
617619

618620

619621

620622
jpeg.lossless.Decoder.prototype.setValue8 = function (index, val) {
621-
this.outputData.setInt16(index, val, true);
623+
this.outputData.setInt8(index, val);
622624
};
623625

624626

625627

626628
jpeg.lossless.Decoder.prototype.getValue8 = function (index) {
627-
return this.outputData.getInt16(index, true);
629+
return this.outputData.getInt8(index);
628630
};
629631

630632

633+
631634
jpeg.lossless.Decoder.prototype.readApp = function() {
632635
var count = 0, length = this.stream.get16();
633636
count += 2;

0 commit comments

Comments
 (0)