diff --git a/src/routes/_components/dialog/components/MediaFocalPointEditor.html b/src/routes/_components/dialog/components/MediaFocalPointEditor.html index 43ec6d2f..e5e7f017 100644 --- a/src/routes/_components/dialog/components/MediaFocalPointEditor.html +++ b/src/routes/_components/dialog/components/MediaFocalPointEditor.html @@ -4,7 +4,8 @@ >
{shortName} { - const width = get(mediaItem, ['data', 'meta', 'original', 'width']) - const height = get(mediaItem, ['data', 'meta', 'original', 'height']) - if (width && height) { - return `${width} x ${height}` - } - return '' // pleroma does not give us original width/height - }, + // intrinsic width/height to avoid layout shifting https://chromestatus.com/feature/5695266130755584 + // note pleroma does not give us intrinsic width/height + intrinsicWidth: ({ mediaItem }) => get(mediaItem, ['data', 'meta', 'original', 'width']), + intrinsicHeight: ({ mediaItem }) => get(mediaItem, ['data', 'meta', 'original', 'height']), scale: ({ nativeWidth, nativeHeight, containerWidth, containerHeight }) => ( intrinsicScale(containerWidth, containerHeight, nativeWidth, nativeHeight) ), diff --git a/src/routes/_components/dialog/components/MediaInDialog.html b/src/routes/_components/dialog/components/MediaInDialog.html index 52036eee..e547de83 100644 --- a/src/routes/_components/dialog/components/MediaInDialog.html +++ b/src/routes/_components/dialog/components/MediaInDialog.html @@ -5,7 +5,8 @@ src={url} {poster} controls - {intrinsicsize} + width={intrinsicWidth} + height={intrinsicHeight} ref:player /> {:elseif type === 'audio'} @@ -29,7 +30,8 @@ loop webkit-playsinline playsinline - {intrinsicsize} + width={intrinsicWidth} + height={intrinsicHeight} /> {:else} {description} {/if}