How to Crop image and then start the upload with nuxt js?
See original GitHub issueThis is a really cool library. But after integrating it with my nuxt js app i am having hard time finding a solution to crop an image and then upload. Shown on the example Profile Picture Code
I have gone throw some of the documentation and its a lot to read. Here is my set up:
<client-only>
<file-pond
name="test"
ref="pond"
label-idle="Drop files here..."
:allow-multiple="true"
allowImagePreview="true"
allowImageTransform="true"
accepted-file-types="image/jpeg, image/png"
:server="{ processFiles }"
:files="myFiles"
image-crop-aspect-ratio="1"
allowImageCrop="true"
v-on:init="handleFilePondInit"/>
</client-only>
import vueFilePond, { setOptions } from 'vue-filepond';
import 'filepond/dist/filepond.min.css';
import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css';
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview';
import FilePondPluginImageCrop from 'filepond-plugin-image-crop';
import FilePondPluginImageTransform from 'filepond-plugin-image-transform';
const FilePond = vueFilePond(
FilePondPluginFileValidateType,
FilePondPluginImagePreview,
FilePondPluginImageCrop,
FilePondPluginImageTransform
);
export default {
name: "vue-file-pond",
data() {
return {
myFiles: []
};
},
methods: {
handleFilePondInit: function() {
console.log('FilePond has initialized');
},
processFiles(filename, file, metadata, load){
load(file);
}
},
components: {
FilePond
},
mounted() {
setOptions({
server: {
url: process.env.APP_URL + '/api/images',
revert: null,
process: {
withCredentials: false,
headers: {
Authorization: 'Bearer ABCD'
}
},
}
});
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Image Crop and Upload in Vuejs - Medium
Today we will see how to crop the image and then upload it in vuejs The story starts when I am trying to...
Read more >Three simple Steps to crop images in vue js. - The Koi
To crop images in vue you can use an awesome package called vue-image-cropper. You just need to first upload an image and pass...
Read more >Nuxtjs brings unexpected token < when importing vue-image ...
I'm trying to make a cropped image and then upload it to amazon in my NuxtJs app. The problem comes when I import...
Read more >Next.js Image Tutorial – How to Upload, Crop, and Resize ...
This post will teach you how to upload, crop, and resize images in the browser. I built this project in a Codesandbox. To...
Read more >Cropping Images in the Browser with Vue.js - YouTube
Learn how to manipulate images in the browser using Vue. js and a simple JavaScript library called cropperjs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you 😃
@DeepMhta07 The edit button only appears when the Image edit plugin is set and an editor has been loaded.