MCPcopy Create free account
hub / github.com/FastLED/FastLED / validateWebP

Function validateWebP

tests/fl/codec/decode_file.hpp:257–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257static void validateWebP(const fl::vector<fl::u8>& data) {
258 if (fl::Jpeg::isSupported()) {
259 fl::JpegConfig config;
260 config.format = fl::PixelFormat::RGB888;
261 fl::string dec_error;
262 fl::FramePtr frame = fl::Jpeg::decode(config, data, &dec_error);
263 if (frame) {
264 FL_CHECK(frame->isValid());
265 FL_CHECK_GT(frame->getWidth(), 0);
266 FL_CHECK_GT(frame->getHeight(), 0);
267 FL_MESSAGE("WebP: " << frame->getWidth() << "x" << frame->getHeight());
268 } else {
269 FL_MESSAGE("WebP decode returned null: " << dec_error);
270 }
271 } else {
272 FL_MESSAGE("WebP/JPEG decoder not supported on this platform");
273 }
274}
275
276// ---------------------------------------------------------------------------
277// Tests

Callers 1

FL_TEST_FILEFunction · 0.85

Calls 3

isValidMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected