File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,14 @@ var getJpegSize = function(imgData) {
5555 if ( imgData . charCodeAt ( i ) !== 0xff ) {
5656 throw new Error ( 'getJpegSize could not find the size of the image' ) ;
5757 }
58- if ( imgData . charCodeAt ( i + 1 ) === 0xc0 ) {
58+ if ( imgData . charCodeAt ( i + 1 ) === 0xc0 || //(SOF) Huffman - Baseline DCT
59+ imgData . charCodeAt ( i + 1 ) === 0xc1 || //(SOF) Huffman - Extended sequential DCT
60+ imgData . charCodeAt ( i + 1 ) === 0xc2 || // Progressive DCT (SOF2)
61+ imgData . charCodeAt ( i + 1 ) === 0xc3 || // Spatial (sequential) lossless (SOF3)
62+ imgData . charCodeAt ( i + 1 ) === 0xc4 || // Differential sequential DCT (SOF5)
63+ imgData . charCodeAt ( i + 1 ) === 0xc5 || // Differential progressive DCT (SOF6)
64+ imgData . charCodeAt ( i + 1 ) === 0xc6 || // Differential spatial (SOF7)
65+ imgData . charCodeAt ( i + 1 ) === 0xc7 ) {
5966 height = imgData . charCodeAt ( i + 5 ) * 256 + imgData . charCodeAt ( i + 6 ) ;
6067 width = imgData . charCodeAt ( i + 7 ) * 256 + imgData . charCodeAt ( i + 8 ) ;
6168 return [ width , height ] ;
You can’t perform that action at this time.
0 commit comments