Skip to content

Commit 430cf78

Browse files
Laurence BankLaurence Bank
authored andcommitted
Fixed regression
1 parent fdcee83 commit 430cf78

File tree

4 files changed

+357
-29
lines changed

4 files changed

+357
-29
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=JPEGDEC
2-
version=1.6.0
2+
version=1.6.1
33
author=Larry Bank
44
maintainer=Larry Bank
55
sentence=Optimized JPEG decoder for MCUs with 32K+ RAM.

src/JPEGDEC.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ void JPEGDEC::getCropArea(int *x, int *y, int *w, int *h)
142142
JPEG_getCropArea(&_jpeg, x, y, w, h);
143143
} /* getCropArea() */
144144

145+
int JPEGDEC::getJPEGType()
146+
{
147+
return (_jpeg.ucMode == 0xc2) ? JPEG_MODE_PROGRESSIVE : JPEG_MODE_BASELINE;
148+
} /* getJPEGType() */
149+
145150
//
146151
// File (SD/MMC) based initialization
147152
//

src/JPEGDEC.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ typedef uint32_t my_ulong;
8484
typedef int32_t my_long;
8585
#endif
8686

87+
// Supported decode modes
88+
enum {
89+
JPEG_MODE_BASELINE = 0,
90+
JPEG_MODE_PROGRESSIVE,
91+
JPEG_MODE_INVALID
92+
};
93+
8794
// Pixel types (defaults to little endian RGB565)
8895
enum {
8996
RGB565_LITTLE_ENDIAN = 0,
@@ -255,6 +262,7 @@ class JPEGDEC
255262
int getBpp();
256263
void setUserPointer(void *p);
257264
int getSubSample();
265+
int getJPEGType();
258266
int hasThumb();
259267
int getThumbWidth();
260268
int getThumbHeight();

0 commit comments

Comments
 (0)