Logo
Explore Help
Sign In
cottongin/immich-frame
1
0
Fork 0
You've already forked immich-frame
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
ef475b493decced41fafd6c530061fff74d25515
immich-frame/src/stb_image_impl.cpp

16 lines
467 B
C++
Raw Normal View History

feat: replace JPEGDEC with stb_image for robust JPEG decoding JPEGDEC (error 3: UNSUPPORTED_FEATURE) and M5GFX's TJpgDec both failed on ~70% of Immich preview images due to: - Optimized Huffman tables exceeding 12-bit DC code limit - Extended sequential mode (SOF1) misidentified as baseline - Progressive JPEG not handled by either decoder stb_image.h handles all standard JPEG modes (baseline, progressive, extended sequential, arbitrary Huffman tables) in a single decoder. Changes: - Add vendored stb_image.h (JPEG-only, PSRAM allocator) - Rewrite decodeAndFit() to use stbi_load_from_memory() - Remove JPEGDEC library dependency - Remove jpegDrawCallback, DecodeContext, parseJpegHeader, decodeFallbackLGFX (all obsolete) - Flash usage decreased: 1345KB -> 1317KB Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 20:22:06 -04:00
#include <esp_heap_caps.h>
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ONLY_JPEG
#define STBI_NO_STDIO
#define STBI_NO_HDR
#define STBI_NO_LINEAR
#define STBI_MALLOC(sz) heap_caps_malloc(sz, MALLOC_CAP_SPIRAM)
#define STBI_REALLOC(p,newsz) heap_caps_realloc(p, newsz, MALLOC_CAP_SPIRAM)
#define STBI_FREE(p) free(p)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#include "stb_image.h"
#pragma GCC diagnostic pop
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 76ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API