three
Advanced tools
Comparing version 0.140.1 to 0.140.2
@@ -350,3 +350,3 @@ import { | ||
if ( typeof OffscreenCanvas !== 'undefined' ) { | ||
if ( typeof document === 'undefined' && typeof OffscreenCanvas !== 'undefined' ) { | ||
@@ -1119,4 +1119,23 @@ cachedCanvas = new OffscreenCanvas( 1, 1 ); | ||
toBlobPromise = canvas.convertToBlob( { type: mimeType } ); | ||
let quality; | ||
// Blink's implementation of convertToBlob seems to default to a quality level of 100% | ||
// Use the Blink default quality levels of toBlob instead so that file sizes are comparable. | ||
if ( mimeType === 'image/jpeg' ) { | ||
quality = 0.92; | ||
} else if ( mimeType === 'image/webp' ) { | ||
quality = 0.8; | ||
} | ||
toBlobPromise = canvas.convertToBlob( { | ||
type: mimeType, | ||
quality: quality | ||
} ); | ||
} | ||
@@ -1123,0 +1142,0 @@ |
{ | ||
"name": "three", | ||
"version": "0.140.1", | ||
"version": "0.140.2", | ||
"description": "JavaScript 3D library", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is too big to display
33069399
422846