Fix #15 Support live photos and HEIC images

This commit is contained in:
Alan Grainger
2024-11-12 09:48:03 +01:00
parent 6608d8ca5b
commit b5265edb6a
8 changed files with 51 additions and 29 deletions
+1 -10
View File
@@ -1,6 +1,5 @@
import dayjs from 'dayjs'
import { Request, Response } from 'express-serve-static-core'
import { ImageSize } from './types'
import { Response } from 'express-serve-static-core'
let config = {}
try {
@@ -31,14 +30,6 @@ export const getConfigOption = (path: string, defaultOption?: unknown) => {
*/
export const log = (message: string) => console.log(dayjs().format() + ' ' + message)
/**
* Sanitise the data for an incoming query string `size` parameter
* e.g. https://example.com/share/abc...xyz?size=thumbnail
*/
export function getSize (req: Request) {
return req.query?.size === 'thumbnail' ? ImageSize.thumbnail : ImageSize.original
}
/**
* Force a value to be a string
*/