mirror of
https://github.com/mue/mue.git
synced 2026-07-17 14:04:09 +02:00
style: improve item page, update photo width/height code
This commit is contained in:
@@ -52,9 +52,9 @@ export default function PhotoInformation(props) {
|
||||
|
||||
// get resolution
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
setWidth(this.width);
|
||||
setHeight(this.height);
|
||||
img.onload = (event) => {
|
||||
setWidth(event.target.width);
|
||||
setHeight(event.target.height);
|
||||
}
|
||||
img.src = props.url;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user