Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
vue-cropgram
Advanced tools
If you are only looking to crop images like in Instagram, please visit https://github.com/avidofood/vue-instagram-cropper 😜
npm install vue-cropgram
import CropGram from 'vue-cropgram'
Vue.component('crop-gram', CropGram);
import { Plugin } from 'vue-cropgram'
Vue.use(Plugin);
<crop-gram ref="cropgram"></crop-gram>
Just an example:
<crop-gram
ref="cropgram"
canvas-color="#F7F7F7"
placeholder-color="#67ACFD"
selection-text-class="px-2 mb-1 text-left small-9 text-uppercase text-primary2 spacing-05"
force-cache-break
selection-text="Choosen images"
placeholder="Choose an image"
:items="pictures"
:show-cropper="currentTab == 'pictures'"
:placeholder-font-size="16"
:file-size-limit="20000 * 1024"
@init="$emit('init')"
@set-view="currentTab = 'pictures'"
>
<shows-instagram-feed-as-an-example
v-show="currentTab == 'instagram'"
:has-token="hasToken"
/>
</crop-gram>
https://avidofood.github.io/vue-cropgram
IMPORTANT: This package contains the props of https://avidofood.github.io/vue-instagram-cropper as well. Please have a check!
showCropper
(default: true
, type: Boolean)Perfect to hide the cropper, but still shows the selected images. Usefull, when you want to show something else.
items
(default: []
, type: Array)Contains all your pictures you want to contain. Important, they must be valid URLs. Visit the demo page to have a look.
mimeType
(default: image/jpeg
, type: String)
compression
(default: 0.8
, type: Number)
selectionText
(default: Chosen Images
, type: String)
selectionTextClass
(default: ''
, type: String)
itemsLimit
(default: 4
, type: Number)
Limits how many images can be choosen.
IMPORTANT: Same as for props, this package contains the events of https://avidofood.github.io/vue-instagram-cropper as well. Please have a check!
choose-file-button
: Emitted only when the Choose-File-Button was used.set-view
: Emitted when the view was changedlimit-reached
: Emitted when the limit of itemsLimit
was reachedhas-changed
: Emitted when images are added, moved, zoomed in/out or the order changed.thumbnail-error(index)
: Emitted when thumbnail is not loaded.You need to set ref=cropgram
to the HTML tag <crop-gram>
. After that you can call all methods like this this.$refs.cropgram.save()
.
save()
: Results a promise with an array of objects. Contains url
or blob
as a result. Here is an example how you can send this to your backend:createFormData() {
const result = await this.$refs.cropgram.save()
const data = new FormData();
//list of your pics
result.forEach((picture, index) => {
data.append(`media[${index}]`, picture.url || picture.blob);
});
return data;
},
getCurrentCropperThumbnail()
: Get's thumbnail of the current viewchooseFile()
: Choose a filesetView(id)
: Sets a view with indexaddNewUrl(url)
: Sets an image via URLI have only limited time to develop this package further. It would mean a lot to me, if you would help me to improve it step by step. This package contains my cropper package that also has a todo list. Have a look: vue-instagram-cropper and here is a small list, what is still missing for this package:
forceAspect
but for vue-instagram-cropper.If you discover any security related issues, please don't email me. I'm afraid 😱. avidofood@protonmail.com
Now comes the best part! 😍 This package is based on
Oh come on. You read everything?? If you liked it so far, hit the ⭐️ button to give me a 🤩 face.
FAQs
Instagram Style Image Uploader for Vue
The npm package vue-cropgram receives a total of 0 weekly downloads. As such, vue-cropgram popularity was classified as not popular.
We found that vue-cropgram demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.