style: improve item page, update photo width/height code

This commit is contained in:
David Ralph
2021-07-15 15:08:37 +01:00
parent c07d7ecbb0
commit c725ad4cc3
4 changed files with 32 additions and 22 deletions

View File

@@ -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;