# is-webp **Repository Path**: openharmony-sig/is-webp ## Basic Information - **Project Name**: is-webp - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 18 - **Created**: 2022-04-16 - **Last Updated**: 2025-05-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # is-webp ## Introduction > is-webp is a library that determines whether images are in WebP format based on file data. ![operation.png](screenshots/operation.png) ## How to Install ```shell ohpm install is-webp ``` For details about the OpenHarmony ohpm environment configuration, see [OpenHarmony HAR](https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_har_usage.en.md). ## How to Use 1. Import files and code dependencies. ``` import resourceManager from '@ohos.resourceManager'; import isWebp from 'is-webp'; ``` 2. Call the method to determine the image format. ``` resourceManager.getResourceManager((error, mgr) => { mgr.getMedia($r("app.media.fixture_webp") .id).then(value => { console.info("loadWebp isWebp:" + isWebp(value)); }).catch(error => { console.log("loadWebp getMedia promise " + error); }); }); ``` ## Available APIs Checks whether the format **isWebP ()**. ## Constraints This project has been verified in the following version: DevEco Studio: NEXT Beta1-5.0.3.806, SDK: API12 Release (5.0.0.66) DevEco Studio: 4.0 Beta2(4.0.3.512), SDK: API10 (4.0.10.9) DevEco Studio: 3.1Beta2(3.1.0.400), SDK: API9 Release(3.2.11.9) ## Directory Structure ```` |---- is-webp | |---- entry # Sample code | |---- src | |---- main | |---- ets | |---- MainAbility | |---- pages | |---- index.ets | |---- README.md # Readme ```` ## How to Contribute If you find any problem during the use, submit an [Issue](https://gitee.com/openharmony-sig/is-webp/issues) or [PR](https://gitee.com/openharmony-sig/is-webp/pulls) to us. ## License This project is licensed under[Apache License 2.0](https://gitee.com/openharmony-sig/is-webp/blob/master/LICENSE).