@mux/blurup
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
import { imageDimensionsFromStream } from 'image-dimensions'; | ||
import { imageDimensionsFromData } from 'image-dimensions'; | ||
@@ -87,2 +87,15 @@ const defaultOptions = { | ||
async function imageDimensionsFromStream(stream) { | ||
let chunks = []; | ||
for await (const chunk of stream) { | ||
chunks = [...chunks, ...chunk]; | ||
const dimensions = imageDimensionsFromData(new Uint8Array(chunks)); | ||
if (dimensions) { | ||
return dimensions; | ||
} | ||
} | ||
} | ||
async function getTinyImageDataURL(imageURL, fetchOptions) { | ||
@@ -89,0 +102,0 @@ const response = await fetch(imageURL, fetchOptions); |
{ | ||
"name": "@mux/blurup", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Generate a blurry image placeholder for a Mux video.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10316
129