youmoula / jcrop

Automatically exported from code.google.com/p/jcrop
0 stars 0 forks source link

Please add following API Call "setImageSize" #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In my image editing tool I have a slider that allows the user to also resize 
the image while jCrop is enabled over that very image. JCrop doesn't know 
anything of the size update and thus the crop feature gets broken.

I've added the following lines of code to fix this and it works great. But it 
would be awesome if you could add it to your version too :-)

    function setImageSize(size) //{{{
    {
      Selection.release();
      disableCrop();

      var bw = options.boxWidth;
      var bh = options.boxHeight;
      $img.width(size[0]).height(size[1]);
      presize($img, bw, bh);
      boundx = size[0];
      boundy = size[1];
      $img2.width(boundx).height(boundy);
      $trk.width(boundx + (bound * 2)).height(boundy + (bound * 2));
      $div.width(boundx).height(boundy);
      enableCrop();
    }
    //}}}

Original issue reported on code.google.com by tyr...@gmail.com on 20 Dec 2011 at 8:04