react-image-magnify
react-image-magnify copied to clipboard
Dynamic height/width setting
It would be super helpful to be able to only set width or height and have the other value depend on the native height/width of the image... Is that even possible?
the above requested feature would be super useful
It would be super helpful to be able to only set width or height and have the other value depend on the native height/width of the image... Is that even possible? you could get the native height/width of the image and set them for the larger image for now, until the issue is addressed. like below function getImgSize(imgSrc) { var newImg = new Image();
newImg.onload = function() {
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);
}
newImg.src = imgSrc; // this must be done AFTER setting onload
}
It would be super helpful to be able to only set width or height and have the other value depend on the native height/width of the image... Is that even possible? you could get the native height/width of the image and set them for the larger image for now, until the issue is addressed. like below function getImgSize(imgSrc) { var newImg = new Image();
newImg.onload = function() { var height = newImg.height; var width = newImg.width; alert ('The image size is '+width+'*'+height); } newImg.src = imgSrc; // this must be done AFTER setting onload
}
Just left to understand how to use this function to dynamically set width, height for large images