First, i'm french and i'm sorry in advance for mistakes.
I have a cover photo displayed before sending the form.
The person can reposition the image , zoom , etc.
Script : https://github.com/matiasgagliano/guillotine
exemple in french
The problem is that i don't know how to send the new image resized and not the default image. The API has set a function to get info about image :
var data = picture.guillotine('getData');
but i don't where how use this and where. I'm a beginner in JS.
Thanks much.
-
what have you done so far ?Jérôme– Jérôme2016年04月08日 10:16:59 +00:00Commented Apr 8, 2016 at 10:16
-
Good question. I have not tried yet, but I suggest you look at this: stackoverflow.com/questions/2434458/…user4278933– user42789332016年04月08日 10:17:11 +00:00Commented Apr 8, 2016 at 10:17
-
and this Q&A also looks promising stackoverflow.com/questions/23945494/…user4278933– user42789332016年04月08日 10:18:31 +00:00Commented Apr 8, 2016 at 10:18
-
@NimS I tried to change value of a hidden input when the image is resized, but doesn't work.mike thomson– mike thomson2016年04月08日 11:47:53 +00:00Commented Apr 8, 2016 at 11:47
-
@fiprojects I will look at this, thksmike thomson– mike thomson2016年04月08日 11:48:29 +00:00Commented Apr 8, 2016 at 11:48
1 Answer 1
I'm an idiot.
I put that code into the dragging function.
var data = picture.guillotine('getData');
getID("scale").value = data.scale;
getID("x").value = data.x;
getID("y").value = data.y;
The values 3 hidden inputs are used to resized the image in PHP with gb librairy