vue-croppa icon indicating copy to clipboard operation
vue-croppa copied to clipboard

[QUESTION] - Change Image Dynamically

Open sinandomeng opened this issue 6 years ago • 3 comments

Hi @zhanziyang, just wondering how to implement changing of initial image dynamically? Just like when you click a button the initial image will update, so on. This is working pen describing my problem, kindly check https://codepen.io/smplyjr/pen/LmENoM?editors=1010

Thanks 👍

sinandomeng avatar Apr 19 '18 07:04 sinandomeng

The way you did it is right. The only problem is the image link does not support CORS.

image

You see, the there is no Access-Control-Allow-Origin: * in the response headers, which means the image can not be used in the situation. Try changing the link to 'https://picsum.photos/300/300?1524150929365' in the pen and you will find it works.

Related issue: #95 More about cross origin images: https://zhanziyang.github.io/vue-croppa/#/help

zhanziyang avatar Apr 19 '18 15:04 zhanziyang

Yup, I think thats the issue. My mistake not looking over it on the docs. Thanks mate! Another thing, is it normal when croppa doesnt return its promiseBlob when the image was set via initial image? (not the normal upload one)

sinandomeng avatar Apr 22 '18 04:04 sinandomeng

@smplyjr It's not normal. When do you call generateBlob? Can you provide demo that reproduce?

zhanziyang avatar May 12 '18 02:05 zhanziyang