New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

use-correction

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-correction

High-level abstraction over use-cropper. With preview, animations and actually correcting images

latest
Source
npmnpm
Version
1.0.6
Version published
Weekly downloads
0
-100%
Maintainers
0
Weekly downloads
 
Created
Source

Use Correction

High-level abstraction over use-cropper. With preview, animations and actually correcting images

Usage

With ChakraUI

Requires ChakraUI

yarn add @chakra-ui/react @emotion/react @emotion/styled framer-motion
npm add @chakra-ui/react @emotion/react @emotion/styled framer-motion
import { useCorrection } from 'use-correction'
import Correction from 'use-correction/chakra'
import { prepareWorker } from "opencv-tools/workers/correct"

// see opencv-tools for details
const worker = new Worker(new URL('correct-worker.ts', import.meta.url), { type: 'module' })
const workerApi = prepareWorker(worker)

const { correctionProps, actions, view } = useCorrection('/path/to/my-image.jpg', workerApi)

async function correct() {
  const result = await actions.correct()
  // ...
}

return (
  <div>
    {/* ... */}
    <Correction {...correctionProps} />
    <button onClick={actions.preview}>Preview</button>
    <button onClick={actions.reset}>Reset corners</button>
    <button onClick={correct}>Correct image</button>
  </div>
)

Without ChakraUI

import { useCorrection } from 'use-correction'
import { prepareWorker } from "opencv-tools/workers/correct"

// see opencv-tools for details
const worker = new Worker(new URL('correct-worker.ts', import.meta.url), { type: 'module' })
const workerApi = prepareWorker(worker)

const { Correction, correctionProps, actions, view } = useCorrection('/path/to/my-image.jpg', workerApi)

return (
  <Correction {...correctionProps} />
)

FAQs

Package last updated on 28 Jun 2024

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