You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Appear in mod/profile/editicon.php, function preview around line 70 ( $("#user_avatar_preview > img").css({....... ):
function preview(img, selection) {
//add this line to prevent IE/Opera bug
if ( selection.width == 0 || selection.height ==0 ) return;
var origWidth = $("#user_avatar").width(); //get the width of the users master photo
var origHeight = $("#user_avatar").height(); //get the height of the users master photo
var scaleX = 100 / selection.width;
var scaleY = 100 / selection.height;
$("#user_avatar_preview > img").css({
'width' : Math.round(scaleX * origWidth) + 'px',
'height' : Math.round(scaleY * origHeight) + 'px',
'marginLeft' : '-' + Math.round(scaleX * selection.x1) + 'px',
'marginTop' : '-' + Math.round(scaleY * selection.y1) + 'px'
});
}
Problem is that then you just click on an image selection.width and selection.width become 0. After some math manipulation some zeroes and infinity values going to .css function. And IE reject to apply that values.
Solution is to add check
if ( selection.width == 0 || selection.height ==0 ) return;
just in the beginning of a function to prevent IE/Opera confusion.
I'm new in trac system. Let me know if i do wrong report or any hints.
The text was updated successfully, but these errors were encountered:
Original ticket http://trac.elgg.org/ticket/1167 on 39599599-09-28 by trac user mangust, assigned to unknown.
Elgg version: 1.6
Hi, i am fixing profile plugin. Users of my test site can't create avatar on their profiles. I am nearly to fix it. But need help from original coder.
Issue was reported on IE and Opera, but no problem in Firefox.
Message: Invalid argument.
Line: 315
Char: 5
Code: 0
URI: http://live.riki.ru/mod/profile/views/default/js/jquery.imgareaselect-0.4.2.js
I've updated imgareaselect script to latest version from http://odyniec.net/projects/imgareaselect/. Because i seen it work on IE. Problem gone, but
Appear in mod/profile/editicon.php, function preview around line 70 ( $("#user_avatar_preview > img").css({....... ):
function preview(img, selection) {
//add this line to prevent IE/Opera bug
if ( selection.width == 0 || selection.height ==0 ) return;
}
Problem is that then you just click on an image selection.width and selection.width become 0. After some math manipulation some zeroes and infinity values going to .css function. And IE reject to apply that values.
Solution is to add check
if ( selection.width == 0 || selection.height ==0 ) return;
just in the beginning of a function to prevent IE/Opera confusion.
I'm new in trac system. Let me know if i do wrong report or any hints.
The text was updated successfully, but these errors were encountered: