Skip to content

Commit

Permalink
Fixed regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Bank authored and Laurence Bank committed Jul 11, 2024
1 parent fdcee83 commit 430cf78
Show file tree
Hide file tree
Showing 4 changed files with 357 additions and 29 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=JPEGDEC
version=1.6.0
version=1.6.1
author=Larry Bank
maintainer=Larry Bank
sentence=Optimized JPEG decoder for MCUs with 32K+ RAM.
Expand Down
5 changes: 5 additions & 0 deletions src/JPEGDEC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ void JPEGDEC::getCropArea(int *x, int *y, int *w, int *h)
JPEG_getCropArea(&_jpeg, x, y, w, h);
} /* getCropArea() */

int JPEGDEC::getJPEGType()
{
return (_jpeg.ucMode == 0xc2) ? JPEG_MODE_PROGRESSIVE : JPEG_MODE_BASELINE;
} /* getJPEGType() */

//
// File (SD/MMC) based initialization
//
Expand Down
8 changes: 8 additions & 0 deletions src/JPEGDEC.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ typedef uint32_t my_ulong;
typedef int32_t my_long;
#endif

// Supported decode modes
enum {
JPEG_MODE_BASELINE = 0,
JPEG_MODE_PROGRESSIVE,
JPEG_MODE_INVALID
};

// Pixel types (defaults to little endian RGB565)
enum {
RGB565_LITTLE_ENDIAN = 0,
Expand Down Expand Up @@ -255,6 +262,7 @@ class JPEGDEC
int getBpp();
void setUserPointer(void *p);
int getSubSample();
int getJPEGType();
int hasThumb();
int getThumbWidth();
int getThumbHeight();
Expand Down
Loading

0 comments on commit 430cf78

Please sign in to comment.