File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ class ColorSpaceUtils {
289289 }
290290
291291 static get cmyk ( ) {
292- if ( IccColorSpace . isUsable ) {
292+ if ( CmykICCBasedCS . isUsable ) {
293293 try {
294294 return shadow ( this , "cmyk" , new CmykICCBasedCS ( ) ) ;
295295 } catch {
Original file line number Diff line number Diff line change @@ -130,11 +130,15 @@ class IccColorSpace extends ColorSpace {
130130 static get isUsable ( ) {
131131 let isUsable = false ;
132132 if ( this . #useWasm) {
133- try {
134- this . _module = QCMS . _module = this . #load( ) ;
135- isUsable = ! ! this . _module ;
136- } catch ( e ) {
137- warn ( `ICCBased color space: "${ e } ".` ) ;
133+ if ( this . #wasmUrl) {
134+ try {
135+ this . _module = QCMS . _module = this . #load( ) ;
136+ isUsable = ! ! this . _module ;
137+ } catch ( e ) {
138+ warn ( `ICCBased color space: "${ e } ".` ) ;
139+ }
140+ } else {
141+ warn ( "No ICC color space support due to missing `wasmUrl` API option" ) ;
138142 }
139143 }
140144
@@ -169,6 +173,19 @@ class CmykICCBasedCS extends IccColorSpace {
169173 static setOptions ( { iccUrl } ) {
170174 this . #iccUrl = iccUrl ;
171175 }
176+
177+ static get isUsable ( ) {
178+ let isUsable = false ;
179+ if ( IccColorSpace . isUsable ) {
180+ if ( this . #iccUrl) {
181+ isUsable = true ;
182+ } else {
183+ warn ( "No CMYK ICC profile support due to missing `iccUrl` API option" ) ;
184+ }
185+ }
186+
187+ return shadow ( this , "isUsable" , isUsable ) ;
188+ }
172189}
173190
174191export { CmykICCBasedCS , IccColorSpace } ;
You can’t perform that action at this time.
0 commit comments