eugenii / jqueryrotate

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

Can't resize image after rotating #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Rotate an image.
2.  Attempt to resize image.

What is the expected output? What do you see instead?
Image should resize.  Image does not resize.

What version of the product are you using? On what operating system?
jQueryRotate.2.1.js.  Windows 7.  IE8.  (No surprise on IE8, huh?)

Please provide any additional information below.

I fix it by doing this:

// Destroy the image, cause once it has been rotated, it can't be resized.
myObj = document.getElementById('img1');
myPar = myObj.parentNode;
myPar.removeChild(myObj);

// Recreate the image, cause we can't do without it.
var img = document.createElement('img');
document.getElementById('div1').appendChild(img);
img.setAttribute('id', 'img1');
img.setAttribute('src',  'images/Image1.png');
img.setAttribute('style', 'position:absolute;');

// Resize it
$("#imgStache").css({ height: 99, width: 101 });

// Rotate it back
$("#imgStache").rotate(rotValue);

Kind of drastic, but hey it works.  Not terrible flicker.        

Original issue reported on code.google.com by rwag...@gmail.com on 16 Feb 2012 at 4:11

GoogleCodeExporter commented 9 years ago
After the fact, I can see that someone in issue 34 did something similar, but 
didn't provide detail.

Original comment by rwag...@gmail.com on 16 Feb 2012 at 4:14

GoogleCodeExporter commented 9 years ago
Oops.  imgStache should be img1 in all instances.  I wish I could edit it.

Original comment by rwag...@gmail.com on 16 Feb 2012 at 4:38

GoogleCodeExporter commented 9 years ago
Well problem here is that plugin for now does not support resizing objects on 
fly. It would slow down overall rotation as internally it's using computed 
sizes. I could think to find some workarounds here. I will put this issue on my 
list!

Original comment by wil...@gmail.com on 16 Feb 2012 at 10:01

GoogleCodeExporter commented 9 years ago
Well its damn tricky especially with support of IE and canvas hmm... Of course 
recreating object on the fly is acceptable in some scenarios but its a huge 
overhead :( 

Original comment by wil...@gmail.com on 13 Mar 2012 at 11:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
i'm trying drag,resize and rotate in the same image, but it doesn't work.from 
china

Original comment by def...@gmail.com on 3 Aug 2012 at 1:54