@hyperframes/studio-server 0.8.4 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4103,6 +4103,7 @@ var thumbnailGenerationCoordinator = new ThumbnailGenerationCoordinator(1);
|
|
|
4103
4103
|
var THUMBNAIL_CACHE_VERSION = "v4";
|
|
4104
4104
|
var THUMBNAIL_MAX_OUTPUT_WIDTH = 240;
|
|
4105
4105
|
var THUMBNAIL_MAX_OUTPUT_HEIGHT = 135;
|
|
4106
|
+
var STORYBOARD_MAX_OUTPUT_DIMENSION = 1080;
|
|
4106
4107
|
var THUMBNAIL_CACHE_MAX_BYTES = 512 * 1024 * 1024;
|
|
4107
4108
|
var THUMBNAIL_CACHE_MAX_AGE_MS = 14 * 24 * 60 * 60 * 1e3;
|
|
4108
4109
|
var prunedCacheDirs = /* @__PURE__ */ new Set();
|
|
@@ -4167,7 +4168,7 @@ function registerThumbnailRoutes(api, adapter) {
|
|
|
4167
4168
|
const format = url.searchParams.get("format") === "png" ? "png" : "jpeg";
|
|
4168
4169
|
const contentType = format === "png" ? "image/png" : "image/jpeg";
|
|
4169
4170
|
const requestedOutput = url.searchParams.get("output");
|
|
4170
|
-
const outputMode = requestedOutput === "source"
|
|
4171
|
+
const outputMode = requestedOutput === "source" ? "source" : requestedOutput === "storyboard" ? "storyboard" : requestedOutput !== "preview" && format === "png" ? "source" : "preview";
|
|
4171
4172
|
const rawSelectorIndex = Number.parseInt(url.searchParams.get("selectorIndex") || "0", 10);
|
|
4172
4173
|
const selectorIndex = Number.isFinite(rawSelectorIndex) && rawSelectorIndex > 0 ? rawSelectorIndex : void 0;
|
|
4173
4174
|
const urlVersion = url.searchParams.get("v") || "";
|
|
@@ -4205,7 +4206,11 @@ function registerThumbnailRoutes(api, adapter) {
|
|
|
4205
4206
|
const cacheDir = join11(project.dir, ".thumbnails");
|
|
4206
4207
|
const selectorKey = selector ? `_${selector.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 80)}_${selectorIndex ?? 0}` : "";
|
|
4207
4208
|
const urlVersionKey = urlVersion ? `_${urlVersion.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 32)}` : "";
|
|
4208
|
-
const outputScale = outputMode === "source" ? 1 : Math.min(
|
|
4209
|
+
const outputScale = outputMode === "source" ? 1 : outputMode === "storyboard" ? Math.min(
|
|
4210
|
+
1,
|
|
4211
|
+
STORYBOARD_MAX_OUTPUT_DIMENSION / compW,
|
|
4212
|
+
STORYBOARD_MAX_OUTPUT_DIMENSION / compH
|
|
4213
|
+
) : Math.min(1, THUMBNAIL_MAX_OUTPUT_WIDTH / compW, THUMBNAIL_MAX_OUTPUT_HEIGHT / compH);
|
|
4209
4214
|
const outputWidth = Math.max(1, Math.round(compW * outputScale));
|
|
4210
4215
|
const outputHeight = Math.max(1, Math.round(compH * outputScale));
|
|
4211
4216
|
const cacheKey = `${THUMBNAIL_CACHE_VERSION}${urlVersionKey}${manualEditsKey}${motionKey}${sourceKey}_${format}_${outputMode}_${compPath.replace(/\//g, "_")}_${compW}x${compH}_${outputWidth}x${outputHeight}_${sourceMtime}_${seekTime.toFixed(2)}${selectorKey}.${format === "png" ? "png" : "jpg"}`;
|