matiasgali / guillotine

jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
http://guillotine.js.org
327 stars 100 forks source link

Init Guillotine with preset x, y, zoom, scale & rotation #26

Closed redfellow closed 9 years ago

redfellow commented 9 years ago

I'm storing Guillotine data on saving a page, and would like to return it to previous state upon returning (we don't actually crop the image on an edit page, so that editors can easily finetune the image positions if they choose to edit an existing page).

Would be nice if Guillotine supported it's own getData object when initing.

For example like this:

image.guillotine({
        w : 500,
        h : 400,
        x : 100,
        y : 50,
        angle : 0,
        scale: 1,
        eventOnChange: 'guillotinechange'
});

Or simply image.guillotine({ data: dataobject, eventOnChange: 'guillotinechange' });

matiasgali commented 9 years ago

How is this different from the init option described in the API?

redfellow commented 9 years ago

I'm sorry, I read the README.md through a couple of times but evidently managed to skim over that option completely. :+1:

matiasgali commented 9 years ago

Not a problem, it happens. :+1: