Fix #15 Support live photos and HEIC images
This commit is contained in:
+1
-10
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user