UNPKG

@panoramax/web-viewer

Version:

Panoramax web viewer for geolocated pictures

746 lines (724 loc) 23.2 kB
import * as picture from "../../src/utils/picture"; describe("getExifFloat", () => { it.each([ [undefined, undefined], [null, undefined], ["", undefined], [" ", undefined], [1, 1], [1.4, 1.4], ["1", 1], ["-1.4", -1.4], ["-104/10", -10.4], ["-104.12/-12.12", 8.590759075907592], ])("works with %s", (input, expected) => { expect(picture.getExifFloat(input)).toBe(expected); }); }); describe("getGPSPrecision", () => { it.each([ [undefined, null], [0.4, "0.4 m"], [0.9, "0.9 m"], [2.9, "2.9 m"], [6.9, "6.9 m"], [9.9, "9.9 m"], [20, "20 m"], ["9/10", "0.9 m"], ["99/10", "9.9 m"], ])("handles GPSHPos %s > %s", (input, expected) => { const p = { properties: { exif: { "Exif.GPSInfo.GPSHPositioningError": input, "Exif.GPSInfo.GPSDOP": input } } }; expect(picture.getGPSPrecision(p)).toBe(expected); }); it.each([ [undefined, null], [0.9, "ideal"], [1.9, "excellent"], [4.9, "good"], [9.9, "moderate"], [19.9, "fair"], [20, "poor"], ["1/1", "excellent"], ["15/10", "excellent"], ])("handles GPSDOP %s > %s", (input, expected) => { const p = { properties: { exif: { "Exif.GPSInfo.GPSDOP": input } } }; expect(picture.getGPSPrecision(p)).toBe(expected); }); }); describe("getSphereCorrection", () => { it("works with API props", () => { const p = { properties: { "view:azimuth": 50, "pers:yaw": 42, "pers:pitch": -30, "pers:roll": 72.2 } }; expect(picture.getSphereCorrection(p)).toMatchSnapshot(); }); it("works with exif tags", () => { const p = { properties: { exif: { "Xmp.Camera.Pitch": "-30/1", "Xmp.GPano.PoseRollDegrees": 72.2, "Exif.MpfInfo.MPFYawAngle": 42, }, "view:azimuth": 50, } }; expect(picture.getSphereCorrection(p)).toMatchSnapshot(); }); }); describe("getCroppedPanoData", () => { it("works with API props", () => { const p = { properties: { "pers:interior_orientation": { "sensor_array_dimensions": [15872,7936], "visible_area": [0,2538,0,2792] } } }; expect(picture.getCroppedPanoData(p)).toMatchSnapshot(); }); it("works with exif tags", () => { const p = { properties: { exif: { "Xmp.GPano.CroppedAreaImageHeightPixels": "2606", "Xmp.GPano.CroppedAreaImageWidthPixels": "15872", "Xmp.GPano.CroppedAreaLeftPixels": "0", "Xmp.GPano.CroppedAreaTopPixels": "2538", "Xmp.GPano.FullPanoHeightPixels": "7936", "Xmp.GPano.FullPanoWidthPixels": "15872", }, } }; expect(picture.getCroppedPanoData(p)).toMatchSnapshot(); }); it("works with API props and unneeded", () => { const p = { properties: { "pers:interior_orientation": { "sensor_array_dimensions": [15872,7936], "visible_area": [0,0,0,0] } } }; expect(picture.getCroppedPanoData(p)).toMatchSnapshot(); }); it("works with exif tags and unneeded", () => { const p = { properties: { exif: { "Xmp.GPano.CroppedAreaImageHeightPixels": "7936", "Xmp.GPano.CroppedAreaImageWidthPixels": "15872", "Xmp.GPano.CroppedAreaLeftPixels": "0", "Xmp.GPano.CroppedAreaTopPixels": "0", "Xmp.GPano.FullPanoHeightPixels": "7936", "Xmp.GPano.FullPanoWidthPixels": "15872", }, } }; expect(picture.getCroppedPanoData(p)).toMatchSnapshot(); }); }); describe("sortPicturesInDirection", () => { it("works with next/prev links", () => { const sort = picture.sortPicturesInDirection([0,0]); let res = sort({rel: "prev"}, {rel: "next"}); expect(res).toBe(0); res = sort({rel: "prev"}, {rel: "related"}); expect(res).toBe(-1); res = sort({rel: "related"}, {rel: "next"}); expect(res).toBe(1); }); it("works with related at different dates", () => { const sort = picture.sortPicturesInDirection([0,0]); let res = sort( {rel: "related", date: "2023-01-01"}, {rel: "related", date: "2022-01-01"} ); expect(res).toBe(-1); // Most recent goes first res = sort( {rel: "related", date: "2022-01-01"}, {rel: "related", date: "2023-01-01"} ); expect(res).toBe(1); }); it("works with related at same date", () => { const sort = picture.sortPicturesInDirection([0,0]); let res = sort( {rel: "related", date: "2023-01-01", geometry: {coordinates: [0.1,0.1]}}, {rel: "related", date: "2023-01-01", geometry: {coordinates: [0.5,0.5]}} ); expect(res).toBeLessThan(0); // Nearest goes first res = sort( {rel: "related", date: "2023-01-01", geometry: {coordinates: [0.5,0.5]}}, {rel: "related", date: "2023-01-01", geometry: {coordinates: [0.1,0.1]}} ); expect(res).toBeGreaterThan(0); res = sort( {rel: "related", date: "2023-01-01", geometry: {coordinates: [0.1,0.1]}}, {rel: "related", date: "2023-01-01", geometry: {coordinates: [0.1,0.1]}} ); expect(res).toBe(0); }); }); describe("getNodeCaption", () => { it("works with date", () => { const m = { properties: { datetime: "2022-02-01T12:15:36Z" } }; global.Date = jest.fn(() => ({ toLocaleDateString: () => "February 2 2022" })); const res = picture.getNodeCaption(m, { pnx: { metadata_general_license_link: "" }}); expect(res).toMatchSnapshot(); }); it("works with date+tz", () => { const m = { properties: { datetimetz: "2022-02-01T12:15:36-03:00" } }; global.Date = jest.fn(() => ({ toLocaleDateString: () => "February 2 2022" })); const res = picture.getNodeCaption(m, { pnx: { metadata_general_license_link: "" }}); expect(res).toMatchSnapshot(); }); it("works with producer", () => { const m = { providers: [ { name: "PanierAvide", roles: ["producer", "licensor"] } ] }; const res = picture.getNodeCaption(m, { pnx: { metadata_general_license_link: "" }}); expect(res).toMatchSnapshot(); }); it("works with date + producer", () => { const m = { properties: { datetime: "2022-02-01T12:15:36Z" }, providers: [ { name: "PanierAvide", roles: ["producer", "licensor"] } ] }; global.Date = jest.fn(() => ({ toLocaleDateString: () => "February 2 2022" })); const res = picture.getNodeCaption(m, { pnx: { metadata_general_license_link: "" }}); expect(res).toMatchSnapshot(); }); it("works with date + 2 producers", () => { const m = { properties: { datetime: "2022-02-01T12:15:36Z" }, providers: [ { name: "GeoVisio Corp.", roles: ["producer", "licensor"] }, { name: "PanierAvide", roles: ["producer"] }, ] }; global.Date = jest.fn(() => ({ toLocaleDateString: () => "February 2 2022" })); const res = picture.getNodeCaption(m, { pnx: { metadata_general_license_link: "" }}); expect(res).toMatchSnapshot(); }); }); describe("apiFeatureToPSVNode", () => { it("works", () => { const f = { "asset_templates": { "tiles": { "description": "Highest resolution available of this picture, as tiles", "href": "https://panoramax.openstreetmap.fr/api/pictures/00000000-76a0-4bec-b19e-a56f51ef997d/tiled/{TileCol}_{TileRow}.jpg", "roles": [ "data" ], "title": "HD tiled picture", "type": "image/jpeg" } }, "assets": { "hd": { "description": "Highest resolution available of this picture", "href": "https://panoramax.openstreetmap.fr/api/pictures/00000000-76a0-4bec-b19e-a56f51ef997d/hd.jpg", "roles": [ "data" ], "title": "HD picture", "type": "image/jpeg" }, "sd": { "description": "Picture in standard definition (fixed width of 2048px)", "href": "https://panoramax.openstreetmap.fr/api/pictures/00000000-76a0-4bec-b19e-a56f51ef997d/sd.jpg", "roles": [ "visual" ], "title": "SD picture", "type": "image/jpeg" }, "thumb": { "description": "Picture in low definition (fixed width of 500px)", "href": "https://panoramax.openstreetmap.fr/api/pictures/00000000-76a0-4bec-b19e-a56f51ef997d/thumb.jpg", "roles": [ "thumbnail" ], "title": "Thumbnail", "type": "image/jpeg" } }, "bbox": [ -92.70188245, 41.322064692, -92.70188245, 41.322064692 ], "collection": "ec31c324-b43a-425e-a24c-3de56d7914c1", "geometry": { "coordinates": [ -92.70188245, 41.322064692 ], "type": "Point" }, "id": "00000000-76a0-4bec-b19e-a56f51ef997d", "links": [ { "href": "https://panoramax.openstreetmap.fr/api/", "rel": "root", "title": "Instance catalog", "type": "application/json" }, { "href": "https://panoramax.openstreetmap.fr/api/collections/ec31c324-b43a-425e-a24c-3de56d7914c1", "rel": "parent", "type": "application/json" }, { "href": "https://panoramax.openstreetmap.fr/api/collections/ec31c324-b43a-425e-a24c-3de56d7914c1/items/00000000-76a0-4bec-b19e-a56f51ef997d", "rel": "self", "type": "application/geo+json" }, { "href": "https://panoramax.openstreetmap.fr/api/collections/ec31c324-b43a-425e-a24c-3de56d7914c1", "rel": "collection", "type": "application/json" }, { "href": "https://spdx.org/licenses/CC-BY-SA-4.0.html", "rel": "license", "title": "License for this object (CC-BY-SA-4.0)" }, { "geometry": { "coordinates": [ -92.701910458, 41.322081588 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/ec31c324-b43a-425e-a24c-3de56d7914c1/items/5fb8e767-6fe3-4bcb-b19f-7031d9a64fc8", "id": "5fb8e767-6fe3-4bcb-b19f-7031d9a64fc8", "rel": "next", "type": "application/geo+json" }, { "geometry": { "coordinates": [ -92.701854443, 41.322047796 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/ec31c324-b43a-425e-a24c-3de56d7914c1/items/66ea29cd-941c-4201-977f-efb87bd5465e", "id": "66ea29cd-941c-4201-977f-efb87bd5465e", "rel": "prev", "type": "application/geo+json" } ], "properties": { "created": "2024-09-04T02:40:11.836165+00:00", "datetime": "2024-09-01T23:35:37.797105+00:00", "datetimetz": "2024-09-01T23:35:37.797105+00:00", "exif": { "Xmp.GPano.CroppedAreaImageHeightPixels": "2688", "Xmp.GPano.CroppedAreaImageWidthPixels": "5376", "Xmp.GPano.CroppedAreaLeftPixels": "0", "Xmp.GPano.CroppedAreaTopPixels": "0", "Xmp.GPano.FullPanoHeightPixels": "2688", "Xmp.GPano.FullPanoWidthPixels": "5376", "Xmp.GPano.ProjectionType": "equirectangular", "Xmp.GPano.UsePanoramaViewer": "True" }, "geovisio:image": "https://panoramax.openstreetmap.fr/api/pictures/00000000-76a0-4bec-b19e-a56f51ef997d/hd.jpg", "geovisio:producer": "Hopen111", "geovisio:thumbnail": "https://panoramax.openstreetmap.fr/api/pictures/00000000-76a0-4bec-b19e-a56f51ef997d/thumb.jpg", "license": "CC-BY-SA-4.0", "original_file:name": "GS010837-003545.jpg", "original_file:size": 788436, "panoramax:horizontal_pixel_density": 15, "pers:interior_orientation": { "field_of_view": 360, "sensor_array_dimensions": [ 5376, 2688 ] }, "tiles:tile_matrix_sets": { "geovisio": { "identifier": "geovisio-00000000-76a0-4bec-b19e-a56f51ef997d", "tileMatrix": [ { "identifier": "0", "matrixHeight": 4, "matrixWidth": 8, "scaleDenominator": 1, "tileHeight": 672.0, "tileWidth": 672.0, "topLeftCorner": [ 0, 0 ], "type": "TileMatrixType" } ], "title": "GeoVisio tile matrix for picture 00000000-76a0-4bec-b19e-a56f51ef997d", "type": "TileMatrixSetType" } }, "view:azimuth": 309 }, "providers": [ { "id": "cddcb3f2-9b2f-454b-8f03-da7dd6a966e2", "name": "Hopen111", "roles": [ "producer" ] } ], "stac_extensions": [ "https://stac-extensions.github.io/view/v1.0.0/schema.json", "https://stac-extensions.github.io/perspective-imagery/v1.0.0/schema.json", "https://stac-extensions.github.io/tiled-assets/v1.0.0/schema.json" ], "stac_version": "1.0.0", "type": "Feature" }; const res = picture.apiFeatureToPSVNode(f, { pnx: { metadata_general_license_link: "" }}); expect(res).toMatchSnapshot(); }); }); describe("filterRelatedPicsLinks", () => { it("works", () => { const f = { "assets": { "hd": { "description": "Highest resolution available of this picture", "href": "https://panoramax.openstreetmap.fr/images/df/f1/68/fd/b375-417d-94e5-61dcb619b106.jpg", "roles": [ "data" ], "title": "HD picture", "type": "image/jpeg" }, "sd": { "description": "Picture in standard definition (fixed width of 2048px)", "href": "https://panoramax.openstreetmap.fr/derivates/df/f1/68/fd/b375-417d-94e5-61dcb619b106/sd.jpg", "roles": [ "visual" ], "title": "SD picture", "type": "image/jpeg" }, "thumb": { "description": "Picture in low definition (fixed width of 500px)", "href": "https://panoramax.openstreetmap.fr/derivates/df/f1/68/fd/b375-417d-94e5-61dcb619b106/thumb.jpg", "roles": [ "thumbnail" ], "title": "Thumbnail", "type": "image/jpeg" } }, "bbox": [ 4.8401172, 45.7562227, 4.8401172, 45.7562227 ], "collection": "ada7e5ec-1ee6-4059-9744-82f4c1416248", "geometry": { "coordinates": [ 4.8401172, 45.7562227 ], "type": "Point" }, "id": "dff168fd-b375-417d-94e5-61dcb619b106", "links": [ { "href": "https://panoramax.openstreetmap.fr/api/", "rel": "root", "title": "Instance catalog", "type": "application/json" }, { "href": "https://panoramax.openstreetmap.fr/api/collections/ada7e5ec-1ee6-4059-9744-82f4c1416248", "rel": "parent", "type": "application/json" }, { "href": "https://panoramax.openstreetmap.fr/api/collections/ada7e5ec-1ee6-4059-9744-82f4c1416248/items/dff168fd-b375-417d-94e5-61dcb619b106", "rel": "self", "type": "application/geo+json" }, { "href": "https://panoramax.openstreetmap.fr/api/collections/ada7e5ec-1ee6-4059-9744-82f4c1416248", "rel": "collection", "type": "application/json" }, { "href": "https://spdx.org/licenses/CC-BY-SA-4.0.html", "rel": "license", "title": "License for this object (CC-BY-SA-4.0)" }, { "geometry": { "coordinates": [ 4.8401792, 45.7562024 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/ada7e5ec-1ee6-4059-9744-82f4c1416248/items/38abdc16-b878-4762-a433-33e52e62ae9b", "id": "38abdc16-b878-4762-a433-33e52e62ae9b", "rel": "next", "type": "application/geo+json" }, { "geometry": { "coordinates": [ 4.8400633, 45.7562389 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/ada7e5ec-1ee6-4059-9744-82f4c1416248/items/1c5025ed-3e03-4cf0-8879-7ed9091a9e33", "id": "1c5025ed-3e03-4cf0-8879-7ed9091a9e33", "rel": "prev", "type": "application/geo+json" }, { "datetime": "2023-08-23T07:13:08Z", "geometry": { "coordinates": [ 4.840134667, 45.756240466 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/0ea5e068-a4e5-47b4-a5e2-afefd6f7dec7/items/aaa1ae2f-b48a-4291-972e-030fcd44760b", "id": "aaa1ae2f-b48a-4291-972e-030fcd44760b", "rel": "related", "type": "application/geo+json" }, { "datetime": "2023-06-04T08:17:38Z", "geometry": { "coordinates": [ 4.84012, 45.7561907 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/57c5e57e-d9d4-45d2-8bd5-274e61e9a41a/items/ecc02464-06d5-49dd-937d-6c07d2bebd26", "id": "ecc02464-06d5-49dd-937d-6c07d2bebd26", "rel": "related", "type": "application/geo+json" }, { "datetime": "2022-07-09T11:47:44Z", "geometry": { "coordinates": [ 4.8401801, 45.7562703 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/616e03cc-5f8c-4a75-bd64-c74fbfacb9c3/items/207bed6f-ccdf-4f9b-9b03-2ac5e4fccfe5", "id": "207bed6f-ccdf-4f9b-9b03-2ac5e4fccfe5", "rel": "related", "type": "application/geo+json" }, { "datetime": "2023-07-09T09:36:27Z", "geometry": { "coordinates": [ 4.8400607, 45.7561715 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/857506ff-62ab-4cb7-ae78-9bdd513c6736/items/cd89e407-9e28-413e-9ba8-8515b4590431", "id": "cd89e407-9e28-413e-9ba8-8515b4590431", "rel": "related", "type": "application/geo+json" }, { "datetime": "2024-07-07T12:37:51Z", "geometry": { "coordinates": [ 4.8401379, 45.7561616 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/d1761909-3b69-4741-b70c-e4e4f503a4cb/items/5e1d8461-fe5d-4d57-9c87-f2403baff37d", "id": "5e1d8461-fe5d-4d57-9c87-f2403baff37d", "rel": "related", "type": "application/geo+json" }, { "datetime": "2022-09-18T13:45:48Z", "geometry": { "coordinates": [ 4.8400835, 45.7561967 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/d787c4e7-bad3-428c-b243-206f0376ac47/items/d3ca4cbc-0011-49ca-9b16-47b627b33bd9", "id": "d3ca4cbc-0011-49ca-9b16-47b627b33bd9", "rel": "related", "type": "application/geo+json" }, { "datetime": "2024-09-17T14:34:21Z", "geometry": { "coordinates": [ 4.8400918, 45.7561938 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/ea22bc85-86e7-46ce-8b3b-a8ba70ca1afd/items/abff42de-2862-4b15-8c2a-dca22ed2deaf", "id": "abff42de-2862-4b15-8c2a-dca22ed2deaf", "rel": "related", "type": "application/geo+json" }, { "datetime": "2022-08-21T11:14:20Z", "geometry": { "coordinates": [ 4.8400687, 45.7561978 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/f2e2263c-ad94-4a61-b120-32d780afe321/items/13184780-53de-4f8e-87ae-336ae51cb9e7", "id": "13184780-53de-4f8e-87ae-336ae51cb9e7", "rel": "related", "type": "application/geo+json" }, { "datetime": "2025-09-03T13:36:48Z", "geometry": { "coordinates": [ 4.8401266, 45.7562077 ], "type": "Point" }, "href": "https://panoramax.openstreetmap.fr/api/collections/f8b8741e-8af6-4aad-8531-8b52cf472947/items/839a0e15-c9f6-4bbe-8bd3-0fde1d8cc839", "id": "839a0e15-c9f6-4bbe-8bd3-0fde1d8cc839", "rel": "related", "type": "application/geo+json" } ], "properties": { "created": "2023-06-18T12:01:29.290897+00:00", "datetime": "2023-06-18T10:09:20.701000+00:00", "datetimetz": "2023-06-18T10:09:20.701000+00:00", "exif": { "Exif.GPSInfo.GPSAltitude": "220.305", "Exif.GPSInfo.GPSAltitudeRef": "", "Exif.GPSInfo.GPSDateStamp": "2023:06:18", "Exif.GPSInfo.GPSLatitude": "(45.0, 45.0, 22.40172)", "Exif.GPSInfo.GPSLatitudeRef": "N", "Exif.GPSInfo.GPSLongitude": "(4.0, 50.0, 24.4219199)", "Exif.GPSInfo.GPSLongitudeRef": "E", "Exif.GPSInfo.GPSTimeStamp": "(10.0, 9.0, 20.0)", "Exif.Image.ApertureValue": "2.5", "Exif.Image.CompressedBitsPerPixel": "0.004", "Exif.Image.DateTime": "2023:06:18 12:09:18", "Exif.Image.DateTimeOriginal": "2023:06:18 12:09:18", "Exif.Image.ExposureBiasValue": "0.0", "Exif.Image.ExposureIndex": "1.0668355509971355", "Exif.Image.ExposureProgram": "2", "Exif.Image.ExposureTime": "0.0006680026720106881", "Exif.Image.FNumber": "2.5", "Exif.Image.Flash": "32", "Exif.Image.FocalLength": "3.0", "Exif.Image.ISOSpeedRatings": "100", "Exif.Image.ImageDescription": "DCIM\\126GOPRO\\G0176513.JPG", "Exif.Image.LightSource": "0", "Exif.Image.Make": "GoPro", "Exif.Image.MaxApertureValue": "2.5", "Exif.Image.MeteringMode": "1", "Exif.Image.Model": "HERO9 Black", "Exif.Image.Orientation": "1", "Exif.Image.ResolutionUnit": "2", "Exif.Image.SensingMethod": "2", "Exif.Image.ShutterSpeedValue": "11.0", "Exif.Image.Software": "HD9.01.01.72.70", "Exif.Image.SubjectDistance": "0.0", "Exif.Image.XResolution": "72.0", "Exif.Image.YCbCrPositioning": "1", "Exif.Image.YResolution": "72.0", "Exif.Photo.ApertureValue": "2.5", "Exif.Photo.BodySerialNumber": "C3441327278550", "Exif.Photo.ColorSpace": "0", "Exif.Photo.ComponentsConfiguration": "\u0001\u0002\u0003", "Exif.Photo.CompressedBitsPerPixel": "0.004", "Exif.Photo.Contrast": "0", "Exif.Photo.CustomRendered": "0", "Exif.Photo.DateTimeDigitized": "2023:06:18 12:09:18", "Exif.Photo.DateTimeOriginal": "2023:06:18 12:09:18", "Exif.Photo.DeviceSettingDescription": "", "Exif.Photo.DigitalZoomRatio": "1.0", "Exif.Photo.ExifVersion": "0221", "Exif.Photo.ExposureBiasValue": "0.0", "Exif.Photo.ExposureIndex": "1.0668355509971355", "Exif.Photo.ExposureMode": "0", "Exif.Photo.ExposureProgram": "2", "Exif.Photo.ExposureTime": "0.0006680026720106881", "Exif.Photo.FNumber": "2.5", "Exif.Photo.FileSource": "\u0003", "Exif.Photo.Flash": "32", "Exif.Photo.FocalLength": "3.0", "Exif.Photo.FocalLengthIn35mmFilm": "15", "Exif.Photo.GainControl": "0", "Exif.Photo.ISOSpeedRatings": "100", "Exif.Photo.LightSource": "0", "Exif.Photo.MaxApertureValue": "2.5", "Exif.Photo.MeteringMode": "1", "Exif.Photo.Saturation": "0", "Exif.Photo.SceneCaptureType": "1", "Exif.Photo.SceneType": "\u0001", "Exif.Photo.SensingMethod": "2", "Exif.Photo.Sharpness": "2", "Exif.Photo.ShutterSpeedValue": "11.0", "Exif.Photo.SubjectDistance": "0.0", "Exif.Photo.SubjectDistanceRange": "0", "Exif.Photo.WhiteBalance": "0" }, "geovisio:image": "https://panoramax.openstreetmap.fr/images/df/f1/68/fd/b375-417d-94e5-61dcb619b106.jpg", "geovisio:producer": "Blueberry", "geovisio:status": "ready", "geovisio:thumbnail": "https://panoramax.openstreetmap.fr/derivates/df/f1/68/fd/b375-417d-94e5-61dcb619b106/thumb.jpg", "license": "CC-BY-SA-4.0", "original_file:name": "12h09m18-7010.jpg", "original_file:size": 3405656, "panoramax:horizontal_pixel_density": 56, "pers:interior_orientation": { "camera_manufacturer": "GoPro", "camera_model": "HERO9 Black", "field_of_view": 92, "focal_length": 3.0, "sensor_array_dimensions": [ 5184, 3888 ] }, "quality:horizontal_accuracy": 4.0, "view:azimuth": 108 }, "providers": [ { "id": "d259d230-dbdc-43c7-bf36-5c62a70a2363", "name": "Blueberry", "roles": [ "producer" ] } ], "stac_extensions": [ "https://stac-extensions.github.io/view/v1.0.0/schema.json", "https://stac-extensions.github.io/perspective-imagery/v1.0.0/schema.json" ], "stac_version": "1.0.0", "type": "Feature" }; const res = picture.filterRelatedPicsLinks(f); expect(res).toMatchSnapshot(); }); });