Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 11, 2020
1 parent 97bb342 commit b6431f0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/eez/libs/image/jpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,23 @@ bool jpegDecode(const char *filePath, Image *image) {
if (jpegInfo.ChromaSubsampling == JPEG_420_SUBSAMPLING) {
blockSize = YCBCR_420_BLOCK_SIZE;
if ((width % 16) != 0) {
//lineOffset = 16 - (width % 16);
lineOffset = 16 - (width % 16);
}
} else if (jpegInfo.ChromaSubsampling == JPEG_422_SUBSAMPLING) {
blockSize = YCBCR_422_BLOCK_SIZE;
if ((width % 16) != 0) {
//lineOffset = 16 - (width % 16);
lineOffset = 16 - (width % 16);
}
} else {
// JPEG_444_SUBSAMPLING
blockSize = YCBCR_444_BLOCK_SIZE;
if ((width % 8) != 0) {
//lineOffset = 8 - (width % 8);
lineOffset = 8 - (width % 8);
}
}

jpegInfo.ImageWidth += lineOffset;

JPEG_YCbCrToRGB_Convert_Function convertFunction;
uint32_t numMCUs;
if (JPEG_GetDecodeColorConvertFunc(&jpegInfo, &convertFunction, &numMCUs) != HAL_OK) {
Expand Down

0 comments on commit b6431f0

Please sign in to comment.