| 255 | } |
| 256 | |
| 257 | static 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 |
no test coverage detected