diff --git a/packages/core/src/blurhash.ts b/packages/core/src/blurhash.ts index 88300b5..5ed3344 100644 --- a/packages/core/src/blurhash.ts +++ b/packages/core/src/blurhash.ts @@ -1,6 +1,6 @@ import { decodeBlurHash } from 'fast-blurhash' import { DEFAULT_PLACEHOLDER_SIZE } from './constants' -import { getScaledDimensions } from './utils' +import { calculateProportionalSize } from './utils' import { rgbaToDataUri } from './utils/dataUri' export interface BlurHashOptions { @@ -27,7 +27,7 @@ export function createPngDataUri( size = DEFAULT_PLACEHOLDER_SIZE, }: BlurHashOptions = {}, ) { - const { width, height } = getScaledDimensions(ratio, size) + const { width, height } = calculateProportionalSize(ratio, size) const rgba = decodeBlurHash(hash, width, height) return rgbaToDataUri(width, height, rgba) } diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index a9abd06..0b43f36 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -15,7 +15,7 @@ export function toElementArray( return [...target] } -export function getScaledDimensions(aspectRatio: number, referenceSize: number) { +export function calculateProportionalSize(aspectRatio: number, referenceSize: number) { let width: number let height: number