
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-image-utilities
Advanced tools
A React component library for image manipulation: cropping, compressing, resizing, format conversion, and effects
A powerful and flexible React component library for image manipulation, providing a comprehensive suite of tools for cropping, compressing, resizing, format conversion, and applying visual effects to images in your web applications.
npm install react-image-utilities
# or
yarn add react-image-utilities
# or
pnpm add react-image-utilities
import { ImageCrop } from 'react-image-utilities';
function App() {
const handleCropComplete = (croppedBlob: Blob) => {
const url = URL.createObjectURL(croppedBlob);
console.log('Cropped image URL:', url);
};
return (
<ImageCrop
image="/path/to/image.jpg" // Can be a File, Blob, or URL string
width={300}
height={200}
aspectRatio={1.5}
allowResize={true}
showGrid={true}
onProcessingComplete={handleCropComplete}
onError={(error) => console.error('Crop error:', error)}
/>
);
}
import { ImageCompress } from 'react-image-utilities';
function App() {
const handleCompressionComplete = (compressedBlob: Blob) => {
console.log('Compressed size:', compressedBlob.size);
};
return (
<ImageCompress
image="/path/to/image.jpg"
quality={75}
maxSizeMB={1}
showProgress={true}
onCompressProgress={(progress) => console.log(`${progress}%`)}
onProcessingComplete={handleCompressionComplete}
onError={(error) => console.error('Compression error:', error)}
/>
);
}
import { ImageResize } from 'react-image-utilities';
function App() {
return (
<ImageResize
image="/path/to/image.jpg"
width={800}
height={600}
maintainAspectRatio={true}
resizeMode="contain"
onProcessingComplete={(resizedBlob) => {
console.log('Resized image:', resizedBlob);
}}
/>
);
}
import { ImageFormat } from 'react-image-utilities';
function App() {
return (
<ImageFormat
image="/path/to/image.jpg"
format="webp"
quality={80}
onProcessingComplete={(convertedBlob) => {
console.log('Converted image:', convertedBlob);
}}
/>
);
}
import { ImageEffects } from 'react-image-utilities';
function App() {
return (
<ImageEffects
image="/path/to/image.jpg"
effect="grayscale"
intensity={75}
onProcessingComplete={(processedBlob) => {
console.log('Processed image:', processedBlob);
}}
/>
);
}
All components share these base props:
| Prop | Type | Description |
|---|---|---|
image | File | Blob | string | The source image (File, Blob, or URL) |
onProcessingComplete | (processedImage: Blob) => void | Callback with processed image |
onError | (error: Error) => void | Error handling callback |
className | string | CSS class name |
style | React.CSSProperties | Inline styles |
validateInput | boolean | Enable input validation |
onValidationError | (error: ValidationError) => void | Validation error callback |
| Prop | Type | Default | Description |
|---|---|---|---|
width | number | Required | Crop area width |
height | number | Required | Crop area height |
aspectRatio | number | undefined | Lock aspect ratio |
allowResize | boolean | true | Enable resize handles |
showGrid | boolean | true | Show grid overlay |
gridColor | string | 'rgba(255,255,255,0.8)' | Grid line color |
| Prop | Type | Default | Description |
|---|---|---|---|
quality | number | 80 | Compression quality (0-100) |
maxSizeMB | number | undefined | Max file size in MB |
showProgress | boolean | true | Show progress bar |
onCompressProgress | (progress: number) => void | undefined | Progress callback |
| Prop | Type | Default | Description |
|---|---|---|---|
width | number | Required | Target width |
height | number | Required | Target height |
maintainAspectRatio | boolean | true | Preserve aspect ratio |
resizeMode | 'contain' | 'cover' | 'stretch' | 'contain' | Resize behavior |
| Prop | Type | Default | Description |
|---|---|---|---|
format | 'jpeg' | 'png' | 'webp' | 'gif' | Required | Target format |
quality | number | 80 | Output quality |
| Prop | Type | Default | Description |
|---|---|---|---|
effect | EffectType | Required | Effect to apply |
intensity | number | 100 | Effect strength |
blurRadius | number | undefined | Blur amount |
type ImageProcessingErrorType =
| 'INVALID_INPUT'
| 'UNSUPPORTED_FORMAT'
| 'COMPRESSION_FAILED'
| 'RESIZE_FAILED'
| 'FORMAT_CONVERSION_FAILED'
| 'EFFECT_APPLICATION_FAILED';
import { ImageCompress, ValidationError } from 'react-image-utilities';
function App() {
return (
<ImageCompress
image={imageFile}
quality={75}
validateInput={true}
onError={(error) => {
if (error.type === 'COMPRESSION_FAILED') {
console.error('Compression failed:', error.message);
}
}}
onValidationError={(error) => {
console.error('Validation failed:', error.message);
}}
retryOnError={true}
maxRetries={3}
/>
);
}
import { checkBrowserSupport } from 'react-image-utilities';
const support = checkBrowserSupport();
if (!support.webp) {
console.warn('WebP format not supported');
}
Image Size Limits
Memory Usage
Processing Time
Image Not Loading
Processing Errors
Performance Issues
We welcome contributions! Please follow these steps:
# Clone the repository
git clone https://github.com/yourusername/react-image-utilities.git
# Install dependencies
npm install
# Start development server
npm run dev
# Run tests
npm test
MIT © [Your Name]
FAQs
A React component library for image manipulation: cropping, compressing, resizing, format conversion, and effects
The npm package react-image-utilities receives a total of 8 weekly downloads. As such, react-image-utilities popularity was classified as not popular.
We found that react-image-utilities demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.