Commit Graph

21 Commits

Author SHA1 Message Date
Frank
d6ee51841b image loader: avoid message flood on error
in case that several "bad" image effect segments competing to use the GIF decoder, we had a flood of repeating user_print messages
2025-11-17 14:27:08 +01:00
Frank
eab946ea87 image loader: allow graceful takeover after error
Allow decoder "takeover" by another segment
a) when last segment has decoding error (unsupported file, etc.)
b) when last segment became inactive
2025-11-17 12:29:47 +01:00
Frank
47153baa0c brackets (typo)
does the same thing as before, but looks clearer.
2025-11-16 19:30:34 +01:00
Frank
16540f58b3 (experimental) adjust image scaling when segment options change during playback
* move scaling calculation and decoder.setDrawPixelCallback() into a separate function
*re-calculate scaling before decoding a new frame
* reset gifWidth and gifHeight to zero in endplayback
2025-11-16 19:18:21 +01:00
Frank
2a120e81f8 image effect: flicker fixer for WS2812b leds driven by RMT
Large file read operations can cause RMT stall leading to flicker.
* wait for RMT driver when lading a new gif, and when decoding a new frame.
2025-11-16 16:08:16 +01:00
Damian Schneider
ca35e9914a Improved 1D support for GIF images, bugfixes, blur option by @DedeHai & @softhack007
- add better support for 1D gifs: use the full gif, row by row, scale if needed
- add blur slider to image FX
- improved safety checks to avoid crashes
- add "fast path" if image size matches virtual segment size
2025-11-14 19:30:26 +01:00
Frank
f9a2099240 always use same GifDecoder initialization
Removed conditional compilation for GifDecoder based on PSRAM availability.
After inspecting the library code, it became clear that any parameter changes for GifDecoder will not impact memory needs - decoder.alloc() always requires 24KB.
2025-11-09 20:30:43 +01:00
Frank
c1979f8bc7 no fun in Germany ;-)
no fun, just rabbits. Lets stay professional.
2025-11-07 12:08:31 +01:00
Frank
c58c6ef268 minor robustness improvement
If seg.name is at least 32 characters long, strncpy will fill the 32-byte window without appending '\0'. This could lead to sporadic errors.
2025-11-07 11:58:55 +01:00
Frank
9115cd17af tiny cleanup, ready to merge 2025-11-07 11:45:46 +01:00
Frank
f955df0488 camelCase, future support, minor cleanup
* use camelCase for local variables
* furure support: rename drawPixelCallback to draw2DPixelCallback
2025-11-07 11:05:44 +01:00
Frank
9564791640 prevent string underflow
if seg.name is empty or shorter than four characters, ``strlen(lastFilename) - 4``  underflows (size_t), so the pointer passed to strcmp lands far before the buffer and triggers undefined behavior.
This patch catches too-short segment names and aborts decoding.
2025-11-07 00:28:40 +01:00
Frank
25391fe765 try to catch / handle Gif decoder OOM gracefully
... by adding an exception handler that will catch OOM inside decoder.alloc().
not tested yet.
2025-11-07 00:11:14 +01:00
Frank
698da84b4a prevent division by zero when image width or height is 0
catch error early before starting the decode/paint loop
2025-11-06 23:09:09 +01:00
Frank
10b3ac0eb1 gifdecoder speedup and bugfixes
* fixed a bug that caused wrong behavior with segment mirroring
    (effects must use virtualHeight() /  virtualWidth() instead of height() / width())
* added image blur as an option (second slider)
* added very basic error reporting for users
*  up to 25% faster, especially with big animated gifs

* made all local variables "static" (don't pollute global namespace)
* drawPixelCallback: cache calculation that do not depend on x/y position
* reduced memory allocations on boards without PSRAM, to avoid crashes
2025-11-06 22:50:59 +01:00
Will Tatam
d9ab878503 Swap to WLED_ENABLE_GIF 2025-02-22 12:56:47 +00:00
Christian Schwinne
6d67dc9828 Proper debug statements 2025-02-22 12:55:43 +00:00
Will Tatam
132244cb42 Fix build errors 2025-02-22 12:53:37 +00:00
Christian Schwinne
255be30b38 Working GIF support 2025-02-22 12:37:59 +00:00
Christian Schwinne
b8a29bcbf8 GIFs work again in principle 2025-02-22 12:37:13 +00:00
Christian Schwinne
e8c09104e1 GIF testing 2025-02-22 12:21:59 +00:00