Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Doc

Manav Rathi7c163a1a7ff2
diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
index 0f78b2d9df..123c2db1cc 100644
--- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
@@ -372,9 +372,9 @@ const ImageEditorOverlay = (props: IProps) => {
);
img.src = srcURLs.url as string;
setFileURL(srcURLs.url as string);
- // We're casting the srcURLs.url to string above, i.e. this code
- // is not meant to run for the live photos scenario. For images,
- // we usually will have the mime type.
+ // The image editing works for images (not live photos or
+ // video), where we should generally also get the MIME type from
+ // our lower layers.
setMIMEType(srcURLs.mimeType);
} else {
img.src = fileURL;
diff --git a/web/packages/media/file.ts b/web/packages/media/file.ts
index 2be0a0dd1c..69182c1d5e 100644
--- a/web/packages/media/file.ts
+++ b/web/packages/media/file.ts
@@ -113,11 +113,13 @@ export interface SourceURLs {
/**
* Best effort attempt at obtaining the MIME type.
*
+ * It will only be present for images generally, which is also the only
+ * scenario where it is needed currently (by the image editor).
+ *
* Known cases where it is missing:
*
* - Live photos (these have a different code path for obtaining the URL).
* - A video that is passes the isPlayable test in the browser.
- *
*/
mimeType?: string;
}