
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
vue-crop-upload
Advanced tools
VueCropUpload is a Vue 3 component that provides image uploading functionality with built-in cropping capabilities. It allows users to select an image file, crop it, and upload it to a specified URL.
VueCropUpload is a Vue 3 component that provides image uploading functionality with built-in cropping capabilities. It allows users to select an image file, crop it, and upload it to a specified URL.
This component uses Cropper.js, a powerful JavaScript image cropping library.
npm install vue-crop-upload
import { VueCropUpload } from 'vue-crop-upload'
import 'vue-crop-upload/dist/style.css'
<template>
<VueCropUpload
:url="uploadUrl"
:extensions="allowedExtensions"
:headers="headers"
:data="additionalData"
:maxFileSize="maxSize"
:aspectRatio="cropAspectRatio"
@error="handleError"
@success="handleSuccess"
>
<template #default="{ activator, progress, loading }">
<button @click="activator" :disabled="loading">
{{ loading ? `Uploading (${progress}%)` : 'Upload Image' }}
</button>
</template>
</VueCropUpload>
</template>
<script>
export default {
methods: {
handleSuccess({ data }) {
console.log('Upload successful:', data)
},
handleError(error) {
console.error('Upload error:', error.message)
}
}
}
</script>
Prop | Type | Default | Description |
---|---|---|---|
url | string | - | The URL to upload the image to (required) |
extensions | string | 'png,jpg,gif,jpeg' | Comma-separated list of allowed file extensions |
headers | object | {} | Additional headers to send with the upload request |
data | object | {} | Additional data to send with the upload request |
ratio | number | - | Aspect ratio for image cropping |
maxFileSize | number | - | Maximum file size in bytes |
Event | Payload | Description |
---|---|---|
success | response | Emitted when the upload is successful |
error | error | Emitted when an error occurs during upload or validation |
The component provides a default slot that exposes the following properties:
activator
: Function to trigger the file selection dialogprogress
: Number representing the upload progress (0-100)loading
: Boolean indicating whether an upload is in progressUse these properties to create your custom upload button UI.
To set up the project for development:
npm install
npm run dev
interface ErrorEvent {
type: 'INVALID_FILE_EXTENSION' | 'FILE_SIZE_EXCEEDED' | 'UPLOAD_ERROR' | 'INVALID_FILE_TYPE';
message: string;
}
Contributions are welcome! Please feel free to submit a Pull Request.
This project uses the following major dependencies:
This project is licensed under the MIT License.
Image cropping functionality is provided by Cropper.js, created by Chen Fengyuan.
This is a Vue 3 implementation inspired by the concept of vue-image-crop-upload, but built from the ground up for Vue 3
FAQs
VueCropUpload is a Vue 3 component that provides image uploading functionality with built-in cropping capabilities. It allows users to select an image file, crop it, and upload it to a specified URL.
The npm package vue-crop-upload receives a total of 0 weekly downloads. As such, vue-crop-upload popularity was classified as not popular.
We found that vue-crop-upload demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.