1
Fork 0

Add coordinates to exif list

This commit is contained in:
viktorstrate 2021-10-10 16:54:02 +02:00
parent b5be84bbe4
commit 57d408cb52
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
16 changed files with 187 additions and 119 deletions

View File

@ -63,7 +63,7 @@
"lint:types": "tsc --noemit",
"jest": "craco test --setupFilesAfterEnv ./testing/setupTests.ts",
"jest:ci": "CI=true craco test --setupFilesAfterEnv ./testing/setupTests.ts --verbose --ci --coverage",
"genSchemaTypes": "apollo client:codegen --target=typescript --globalTypesFile=src/__generated__/globalTypes.ts",
"genSchemaTypes": "apollo client:codegen --target=typescript --globalTypesFile=src/__generated__/globalTypes.ts && prettier --write */**/__generated__/*.ts",
"extractTranslations": "i18next -c i18next-parser.config.js",
"prepare": "(cd .. && npx husky install)"
},

View File

@ -59,6 +59,10 @@ export const SHARE_TOKEN_QUERY = gql`
focalLength
flash
exposureProgram
coordinates {
longitude
latitude
}
}
}
}

View File

@ -3,172 +3,188 @@
// @generated
// This file was automatically generated and should not be edited.
import { MediaType } from "./../../../__generated__/globalTypes";
import { MediaType } from './../../../__generated__/globalTypes'
// ====================================================
// GraphQL query operation: SharePageToken
// ====================================================
export interface SharePageToken_shareToken_album {
__typename: "Album";
id: string;
__typename: 'Album'
id: string
}
export interface SharePageToken_shareToken_media_thumbnail {
__typename: "MediaURL";
__typename: 'MediaURL'
/**
* URL for previewing the image
*/
url: string;
url: string
/**
* Width of the image in pixels
*/
width: number;
width: number
/**
* Height of the image in pixels
*/
height: number;
height: number
}
export interface SharePageToken_shareToken_media_downloads_mediaUrl {
__typename: "MediaURL";
__typename: 'MediaURL'
/**
* URL for previewing the image
*/
url: string;
url: string
/**
* Width of the image in pixels
*/
width: number;
width: number
/**
* Height of the image in pixels
*/
height: number;
height: number
/**
* The file size of the resource in bytes
*/
fileSize: number;
fileSize: number
}
export interface SharePageToken_shareToken_media_downloads {
__typename: "MediaDownload";
title: string;
mediaUrl: SharePageToken_shareToken_media_downloads_mediaUrl;
__typename: 'MediaDownload'
title: string
mediaUrl: SharePageToken_shareToken_media_downloads_mediaUrl
}
export interface SharePageToken_shareToken_media_highRes {
__typename: "MediaURL";
__typename: 'MediaURL'
/**
* URL for previewing the image
*/
url: string;
url: string
/**
* Width of the image in pixels
*/
width: number;
width: number
/**
* Height of the image in pixels
*/
height: number;
height: number
}
export interface SharePageToken_shareToken_media_videoWeb {
__typename: "MediaURL";
__typename: 'MediaURL'
/**
* URL for previewing the image
*/
url: string;
url: string
/**
* Width of the image in pixels
*/
width: number;
width: number
/**
* Height of the image in pixels
*/
height: number;
height: number
}
export interface SharePageToken_shareToken_media_exif_coordinates {
__typename: 'Coordinates'
/**
* GPS longitude in degrees
*/
longitude: number
/**
* GPS latitude in degrees
*/
latitude: number
}
export interface SharePageToken_shareToken_media_exif {
__typename: "MediaEXIF";
id: string;
__typename: 'MediaEXIF'
id: string
/**
* The model name of the camera
*/
camera: string | null;
camera: string | null
/**
* The maker of the camera
*/
maker: string | null;
maker: string | null
/**
* The name of the lens
*/
lens: string | null;
dateShot: any | null;
lens: string | null
dateShot: any | null
/**
* The exposure time of the image
*/
exposure: number | null;
exposure: number | null
/**
* The aperature stops of the image
*/
aperture: number | null;
aperture: number | null
/**
* The ISO setting of the image
*/
iso: number | null;
iso: number | null
/**
* The focal length of the lens, when the image was taken
*/
focalLength: number | null;
focalLength: number | null
/**
* A formatted description of the flash settings, when the image was taken
*/
flash: number | null;
flash: number | null
/**
* An index describing the mode for adjusting the exposure of the image
*/
exposureProgram: number | null;
exposureProgram: number | null
/**
* GPS coordinates of where the image was taken
*/
coordinates: SharePageToken_shareToken_media_exif_coordinates | null
}
export interface SharePageToken_shareToken_media {
__typename: "Media";
id: string;
title: string;
type: MediaType;
__typename: 'Media'
id: string
title: string
type: MediaType
/**
* URL to display the media in a smaller resolution
*/
thumbnail: SharePageToken_shareToken_media_thumbnail | null;
downloads: SharePageToken_shareToken_media_downloads[];
thumbnail: SharePageToken_shareToken_media_thumbnail | null
downloads: SharePageToken_shareToken_media_downloads[]
/**
* URL to display the photo in full resolution, will be null for videos
*/
highRes: SharePageToken_shareToken_media_highRes | null;
highRes: SharePageToken_shareToken_media_highRes | null
/**
* URL to get the video in a web format that can be played in the browser, will be null for photos
*/
videoWeb: SharePageToken_shareToken_media_videoWeb | null;
exif: SharePageToken_shareToken_media_exif | null;
videoWeb: SharePageToken_shareToken_media_videoWeb | null
exif: SharePageToken_shareToken_media_exif | null
}
export interface SharePageToken_shareToken {
__typename: "ShareToken";
token: string;
__typename: 'ShareToken'
token: string
/**
* The album this token shares
*/
album: SharePageToken_shareToken_album | null;
album: SharePageToken_shareToken_album | null
/**
* The media this token shares
*/
media: SharePageToken_shareToken_media | null;
media: SharePageToken_shareToken_media | null
}
export interface SharePageToken {
shareToken: SharePageToken_shareToken;
shareToken: SharePageToken_shareToken
}
export interface SharePageTokenVariables {
token: string;
password?: string | null;
token: string
password?: string | null
}

View File

@ -8,15 +8,15 @@
// ====================================================
export interface albumPathQuery_album_path {
__typename: "Album";
id: string;
title: string;
__typename: 'Album'
id: string
title: string
}
export interface albumPathQuery_album {
__typename: "Album";
id: string;
path: albumPathQuery_album_path[];
__typename: 'Album'
id: string
path: albumPathQuery_album_path[]
}
export interface albumPathQuery {
@ -24,9 +24,9 @@ export interface albumPathQuery {
* Get album by id, user must own the album or be admin
* If valid tokenCredentials are provided, the album may be retrived without further authentication
*/
album: albumPathQuery_album;
album: albumPathQuery_album
}
export interface albumPathQueryVariables {
id: string;
id: string
}

View File

@ -72,6 +72,10 @@ const SIDEBAR_MEDIA_QUERY = gql`
focalLength
flash
exposureProgram
coordinates {
latitude
longitude
}
}
faces {
id
@ -170,6 +174,13 @@ export const MetadataInfo = ({ media }: MediaInfoProps) => {
exif.exposure = `1/${Math.round(1 / exif.exposure)}`
}
const coordinates = media.exif.coordinates
if (!isNil(coordinates)) {
exif.coordinates = `${
Math.round(coordinates.latitude * 1000000) / 1000000
}, ${Math.round(coordinates.longitude * 1000000) / 1000000}`
}
const exposurePrograms = exposureProgramsLookup(t)
if (
@ -246,6 +257,7 @@ const exifNameLookup = (t: TranslationFn): { [key: string]: string } => ({
iso: t('sidebar.media.exif.name.iso', 'ISO'),
focalLength: t('sidebar.media.exif.name.focal_length', 'Focal length'),
flash: t('sidebar.media.exif.name.flash', 'Flash'),
coordinates: t('sidebar.media.exif.name.coordinates', 'Coordinates'),
})
// From https://exiftool.org/TagNames/EXIF.html

View File

@ -3,155 +3,171 @@
// @generated
// This file was automatically generated and should not be edited.
import { MediaType } from "./../../../__generated__/globalTypes";
import { MediaType } from './../../../__generated__/globalTypes'
// ====================================================
// GraphQL query operation: sidebarPhoto
// ====================================================
export interface sidebarPhoto_media_highRes {
__typename: "MediaURL";
__typename: 'MediaURL'
/**
* URL for previewing the image
*/
url: string;
url: string
/**
* Width of the image in pixels
*/
width: number;
width: number
/**
* Height of the image in pixels
*/
height: number;
height: number
}
export interface sidebarPhoto_media_thumbnail {
__typename: "MediaURL";
__typename: 'MediaURL'
/**
* URL for previewing the image
*/
url: string;
url: string
/**
* Width of the image in pixels
*/
width: number;
width: number
/**
* Height of the image in pixels
*/
height: number;
height: number
}
export interface sidebarPhoto_media_videoWeb {
__typename: "MediaURL";
__typename: 'MediaURL'
/**
* URL for previewing the image
*/
url: string;
url: string
/**
* Width of the image in pixels
*/
width: number;
width: number
/**
* Height of the image in pixels
*/
height: number;
height: number
}
export interface sidebarPhoto_media_videoMetadata {
__typename: "VideoMetadata";
id: string;
width: number;
height: number;
duration: number;
codec: string | null;
framerate: number | null;
bitrate: string | null;
colorProfile: string | null;
audio: string | null;
__typename: 'VideoMetadata'
id: string
width: number
height: number
duration: number
codec: string | null
framerate: number | null
bitrate: string | null
colorProfile: string | null
audio: string | null
}
export interface sidebarPhoto_media_exif_coordinates {
__typename: 'Coordinates'
/**
* GPS latitude in degrees
*/
latitude: number
/**
* GPS longitude in degrees
*/
longitude: number
}
export interface sidebarPhoto_media_exif {
__typename: "MediaEXIF";
id: string;
__typename: 'MediaEXIF'
id: string
/**
* The model name of the camera
*/
camera: string | null;
camera: string | null
/**
* The maker of the camera
*/
maker: string | null;
maker: string | null
/**
* The name of the lens
*/
lens: string | null;
dateShot: any | null;
lens: string | null
dateShot: any | null
/**
* The exposure time of the image
*/
exposure: number | null;
exposure: number | null
/**
* The aperature stops of the image
*/
aperture: number | null;
aperture: number | null
/**
* The ISO setting of the image
*/
iso: number | null;
iso: number | null
/**
* The focal length of the lens, when the image was taken
*/
focalLength: number | null;
focalLength: number | null
/**
* A formatted description of the flash settings, when the image was taken
*/
flash: number | null;
flash: number | null
/**
* An index describing the mode for adjusting the exposure of the image
*/
exposureProgram: number | null;
exposureProgram: number | null
/**
* GPS coordinates of where the image was taken
*/
coordinates: sidebarPhoto_media_exif_coordinates | null
}
export interface sidebarPhoto_media_faces_rectangle {
__typename: "FaceRectangle";
minX: number;
maxX: number;
minY: number;
maxY: number;
__typename: 'FaceRectangle'
minX: number
maxX: number
minY: number
maxY: number
}
export interface sidebarPhoto_media_faces_faceGroup {
__typename: "FaceGroup";
id: string;
__typename: 'FaceGroup'
id: string
}
export interface sidebarPhoto_media_faces {
__typename: "ImageFace";
id: string;
rectangle: sidebarPhoto_media_faces_rectangle;
faceGroup: sidebarPhoto_media_faces_faceGroup;
__typename: 'ImageFace'
id: string
rectangle: sidebarPhoto_media_faces_rectangle
faceGroup: sidebarPhoto_media_faces_faceGroup
}
export interface sidebarPhoto_media {
__typename: "Media";
id: string;
title: string;
type: MediaType;
__typename: 'Media'
id: string
title: string
type: MediaType
/**
* URL to display the photo in full resolution, will be null for videos
*/
highRes: sidebarPhoto_media_highRes | null;
highRes: sidebarPhoto_media_highRes | null
/**
* URL to display the media in a smaller resolution
*/
thumbnail: sidebarPhoto_media_thumbnail | null;
thumbnail: sidebarPhoto_media_thumbnail | null
/**
* URL to get the video in a web format that can be played in the browser, will be null for photos
*/
videoWeb: sidebarPhoto_media_videoWeb | null;
videoMetadata: sidebarPhoto_media_videoMetadata | null;
exif: sidebarPhoto_media_exif | null;
faces: sidebarPhoto_media_faces[];
videoWeb: sidebarPhoto_media_videoWeb | null
videoMetadata: sidebarPhoto_media_videoMetadata | null
exif: sidebarPhoto_media_exif | null
faces: sidebarPhoto_media_faces[]
}
export interface sidebarPhoto {
@ -159,9 +175,9 @@ export interface sidebarPhoto {
* Get media by id, user must own the media or be admin.
* If valid tokenCredentials are provided, the media may be retrived without further authentication
*/
media: sidebarPhoto_media;
media: sidebarPhoto_media
}
export interface sidebarPhotoVariables {
id: string;
id: string
}

View File

@ -53,7 +53,9 @@ const DateSelector = ({ filterDate, setFilterDate }: DateSelectorProps) => {
const yearItems = years.map<DropdownItem>(x => ({
value: `${x}`,
label: `${x} and earlier`,
label: t('timeline_filter.date.dropdown_year', '{{year}} and earlier', {
year: x,
}),
}))
items = [...items, ...yearItems]
}

View File

@ -288,6 +288,7 @@
"name": {
"aperture": "Blænde",
"camera": "Kamera",
"coordinates": "Koordinater",
"date_shot": "Dato",
"exposure": "Lukketid",
"exposure_program": "Lukketid program",
@ -319,6 +320,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "Fra i dag",
"dropdown_year": "{{year}} og tidligere",
"label": "Dato"
}
},

View File

@ -288,6 +288,7 @@
"name": {
"aperture": "Blende",
"camera": "Kamera",
"coordinates": "",
"date_shot": "Aufnahmedatum",
"exposure": "Belichtung",
"exposure_program": "Programm",
@ -319,6 +320,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "",
"dropdown_year": "",
"label": ""
}
},

View File

@ -288,6 +288,7 @@
"name": {
"aperture": "Aperture",
"camera": "Camera",
"coordinates": "Coordinates",
"date_shot": "Date shot",
"exposure": "Exposure",
"exposure_program": "Program",
@ -319,6 +320,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "From today",
"dropdown_year": "{{year}} and earlier",
"label": "Date"
}
},

View File

@ -288,6 +288,7 @@
"name": {
"aperture": "Abertura",
"camera": "Cámara",
"coordinates": "",
"date_shot": "Fecha de captura",
"exposure": "Exposición",
"exposure_program": "Programa",
@ -319,6 +320,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "",
"dropdown_year": "",
"label": ""
}
},

View File

@ -288,6 +288,7 @@
"name": {
"aperture": "Ouverture",
"camera": "Modèle",
"coordinates": "",
"date_shot": "Prise de vue",
"exposure": "Vitesse",
"exposure_program": "Programme",
@ -319,6 +320,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "Depuis aujourd'hui",
"dropdown_year": "",
"label": "Date"
}
},

View File

@ -288,6 +288,7 @@
"name": {
"aperture": "Apertura",
"camera": "Fotocamera",
"coordinates": "",
"date_shot": "Data di scatto",
"exposure": "Esposizione",
"exposure_program": "Programma",
@ -319,6 +320,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "",
"dropdown_year": "",
"label": ""
}
},

View File

@ -293,6 +293,7 @@
"name": {
"aperture": "Przysłona",
"camera": "Aparat ",
"coordinates": "",
"date_shot": "Data wykonania",
"exposure": "Ekspozycja",
"exposure_program": "Program",
@ -324,6 +325,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "",
"dropdown_year": "",
"label": ""
}
},

View File

@ -293,6 +293,7 @@
"name": {
"aperture": "Диафрагма",
"camera": "Камера",
"coordinates": "",
"date_shot": "Дата снимка",
"exposure": "Экспозиция",
"exposure_program": "Программа",
@ -324,6 +325,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "",
"dropdown_year": "",
"label": ""
}
},

View File

@ -288,6 +288,7 @@
"name": {
"aperture": "Bländare",
"camera": "Kamera",
"coordinates": "",
"date_shot": "Datum tagen",
"exposure": "Exponering",
"exposure_program": "Program",
@ -319,6 +320,7 @@
"timeline_filter": {
"date": {
"dropdown_all": "",
"dropdown_year": "",
"label": ""
}
},