Note that there are some explanatory texts on larger screens.

plurals
  1. POMake Jcrop tracker not rotate when cropping a rotated image
    primarykey
    data
    text
    <p>I'm trying to crop an image using Jcrop, but when I use jqueryrotate on the image, something weird happens.</p> <p>I rotate the image 90 degress then I activate the JCrop, the JCrop does not follow the image rotated, so I also rotate the Jcrop-holder. The resulting image is ok, but when I select a section to crop, I have noticed that my tracker is also rotated. When I drag it up, it goes right, when I drag it left, it goes down.</p> <p>What happens <img src="https://i.stack.imgur.com/sHcUQ.png" alt="enter image description here"></p> <p>Then it goes <img src="https://i.stack.imgur.com/Xv9A1.png" alt="enter image description here"> How do I make the crop selection tool stay upright?</p> <p>My html:</p> <pre><code> &lt;div class="img-canvas" style="background-color:#cccccc;" &gt; &lt;img id="image_canv" src="&lt;?php echo $imagesource;?&gt;"&gt; &lt;/div&gt; </code></pre> <p>My Jquery:</p> <pre><code>$('#rotatephoto').click(function () { value += 90; JcropAPI = $('#image_canv').data('Jcrop'); if(JcropAPI != null) { JcropAPI.destroy(); } var h = $('.img-canvas').height(); var w = $('.img-canvas').width(); $('.img-canvas').css("position","fixed"); $('.img-canvas').css("width",w); $('.img-canvas').css("height",h); $('#image_canv').Jcrop({ onSelect: showCoords2, onChange: showCoords2, setSelect: [ 0, 100, 50, 50 ] }); JcropAPI = $('#image_canv').data('Jcrop'); JcropAPI.enable(); var h2 = $('.jcrop-holder').height(); var w2 = $('.jcrop-holder').width(); if(h2 &lt; 630) { var tempp = (630 - h2)/2; $('.jcrop-holder').css("margin-top",tempp); } if(w2 &lt; 630) { var tempp = (630 - w2)/2; $('.jcrop-holder').css("margin-left",tempp); } $('.jcrop-holder').rotate(value); $("#image_canv").rotate(value); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload