New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@drivekyte/react-native-image-validators

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@drivekyte/react-native-image-validators

React native image validator library

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
6
Weekly downloads
 
Created
Source

@drivekyte/react-native-image-validators

Image validators

Installation

yarn add @drivekyte/react-native-image-validators

You should add the dependencies below:

yarn add react-native-vision-camera

Follow the react-native-vision-camera installation guide

Run pod install in your root folder.

npx pod-install

OpenCV installation (Android)

Download the latest version of the OpenCV from their website.

Unzip it in a folder and open the build.gradle file inside the unzipped folder. Follow the instructions to add it to your main app project using Android Studio.

Usage

Calculate blurry

import { calculateBlurry } from "@drivekyte/react-native-image-validators";
import { useFrameProcessor } from "react-native-vision-camera";

// ...

const frameProcessor = useFrameProcessor((frame) => {
  "worklet";
  const variation = calculateBlurry(frame);
}, []);

Calculate brightness

import { calculateBrightness } from "@drivekyte/react-native-image-validators";
import { useFrameProcessor } from "react-native-vision-camera";

// ...

const frameProcessor = useFrameProcessor((frame) => {
  "worklet";
  const variation = calculateBrightness(frame);
}, []);

Calculate all variations

import { calculateVariations } from "@drivekyte/react-native-image-validators";
import { useFrameProcessor } from "react-native-vision-camera";

// ...

const frameProcessor = useFrameProcessor((frame) => {
  "worklet";
  const { brightness, blurry } = calculateVariations(frame);
}, []);

Modify your babel.config.js

Add the react-native-reanimated globals to your babel.config.js

module.exports = function (api) {
  api.cache(true);
  return {
    //...
    plugins: [
      [
        "react-native-reanimated/plugin",
        {
          globals: [
            "__scanCodes",
            "__getBlurryVariation",
            "__getBrightnessVariation",
            "__getVariations",
          ],
        },
      ],
    ],
  };
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Keywords

FAQs

Package last updated on 17 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc