You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a silverstripe Module called cropfield. Its adding the functionallity of JCrop to dropzone for uploading (profile)pictures in frontend.
In cropfield.js I am using $('#Dropzone').data('dropzoneInterface').backend.on('complete',function(){...}
(I also tried success instead of complete).
I need to get the size of the original uploaded Image. I do this with:
var pic_real_width = document.querySelector('#cropArea').naturalWidth;
var pic_real_height = document.querySelector('#cropArea').naturalHeight;
But to get the real Values I do have to set a timeout, because when I dont't I allways get 0.
I need a callback function that triggers when the Image is completly uploaded and added to Dom so I can get the real Values for width and height and get rid of the timeout.
You can find my code here:
[https://github.com/TheTigerDuck/silverstripe-cropfield]
By the Way
Thanks for all your awesome work on silverstripe and excuse my bad english.
The text was updated successfully, but these errors were encountered:
No I hanen't. When I use thumbnail I can take the values of width and height from dataURL. Thanks.
$('#Dropzone').data('dropzoneInterface').backend.on('thumbnail',function(dataUrl){ var pic_real_width = dataUrl.width; var pic_real_height = dataUrl.height;
Dear Uncle Cheese,
I made a silverstripe Module called cropfield. Its adding the functionallity of JCrop to dropzone for uploading (profile)pictures in frontend.
In cropfield.js I am using
$('#Dropzone').data('dropzoneInterface').backend.on('complete',function(){...}
(I also tried success instead of complete).
I need to get the size of the original uploaded Image. I do this with:
But to get the real Values I do have to set a timeout, because when I dont't I allways get 0.
I need a callback function that triggers when the Image is completly uploaded and added to Dom so I can get the real Values for width and height and get rid of the timeout.
You can find my code here:
[https://github.com/TheTigerDuck/silverstripe-cropfield]
By the Way
Thanks for all your awesome work on silverstripe and excuse my bad english.
The text was updated successfully, but these errors were encountered: