1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00

fix(web): fixes previous pull request: set asset as profile image (#3415)

* set photoviewer 100% width, fixes transparent ede

* remove unnecessary class

* format fix

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
faupau 2023-07-25 07:17:59 +02:00 committed by GitHub
parent 7d3ec8af37
commit 05fa3092bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { AssetResponseDto, api } from '@api'; import { AssetResponseDto, api } from '@api';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { notificationController, NotificationType } from './notification/notification'; import { notificationController, NotificationType } from './notification/notification';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import domtoimage from 'dom-to-image'; import domtoimage from 'dom-to-image';
@ -13,6 +13,10 @@
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
let imgElement: HTMLDivElement; let imgElement: HTMLDivElement;
onMount(() => {
imgElement.style.width = '100%';
});
const hasTransparentPixels = async (blob: Blob) => { const hasTransparentPixels = async (blob: Blob) => {
const img = new Image(); const img = new Image();
img.src = URL.createObjectURL(blob); img.src = URL.createObjectURL(blob);