File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { browserProtocols, toAbsolute } from './http.js';
22import { cogMediaTypes , geotiffMediaTypes , isMediaType } from "./mediatypes.js" ;
33import { hasText } from './utils.js' ;
44import STACObject from './object.js' ;
5- import URI from 'urijs' ;
65import { browserImageTypes } from './mediatypes.js' ;
76
87/**
@@ -68,9 +67,9 @@ class STACReference extends STACObject {
6867 else if ( ! allowUndefined && typeof this . type === 'undefined' ) {
6968 return false ;
7069 }
71- let uri = new URI ( this . href ) ;
72- let protocol = uri . protocol ( ) . toLowerCase ( ) ;
73- let extension = uri . suffix ( ) . toLowerCase ( ) ;
70+ const uri = this . getAbsoluteUrl ( false ) ;
71+ const protocol = uri . protocol ( ) . toLowerCase ( ) ;
72+ const extension = uri . suffix ( ) . toLowerCase ( ) ;
7473 if ( hasText ( protocol ) && ! browserProtocols . includes ( protocol ) ) {
7574 return false ;
7675 }
Original file line number Diff line number Diff line change @@ -86,17 +86,17 @@ class STAC extends STACHypermedia {
8686 if ( thumbnails . length === 0 ) {
8787 thumbnails = this . getLinks ( ) . filter ( link => link . isPreview ( ) ) ;
8888 }
89- if ( browserOnly ) {
90- // Remove all images that can't be displayed in a browser
91- thumbnails = thumbnails . filter ( img => img . canBrowserDisplayImage ( ) ) ;
92- }
9389 // Some old catalogs use just a asset key
9490 if ( thumbnails . length === 0 ) {
9591 const thumbnail = this . getAsset ( "thumbnail" ) ;
9692 if ( thumbnail ) {
9793 thumbnails . push ( thumbnail ) ;
9894 }
9995 }
96+ if ( browserOnly ) {
97+ // Remove all images that can't be displayed in a browser
98+ thumbnails = thumbnails . filter ( img => img . canBrowserDisplayImage ( ) ) ;
99+ }
100100 if ( prefer && thumbnails . length > 1 ) {
101101 // Prefer one role over the other.
102102 // The two step approach with two filters ensures the same sort bevahiour across all browsers:
You can’t perform that action at this time.
0 commit comments