@gallop.software/studio 2.3.109 → 2.3.111
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/client/index.html +1 -1
- package/dist/server/index.js +10 -32
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/client/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
12
12
|
}
|
|
13
13
|
</style>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DBR9Z-gV.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-DfPQBmNf.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
package/dist/server/index.js
CHANGED
|
@@ -4484,23 +4484,17 @@ async function handleEditImage(request) {
|
|
|
4484
4484
|
const exifMeta = await sharp7(exifCorrectedBuffer).metadata();
|
|
4485
4485
|
const exifWidth = exifMeta.width || 0;
|
|
4486
4486
|
const exifHeight = exifMeta.height || 0;
|
|
4487
|
-
const cropX = Math.max(0, Math.min(
|
|
4488
|
-
const cropY = Math.max(0, Math.min(
|
|
4489
|
-
const cropWidth = Math.
|
|
4490
|
-
const cropHeight = Math.
|
|
4487
|
+
const cropX = Math.max(0, Math.min(crop.x, exifWidth - 1));
|
|
4488
|
+
const cropY = Math.max(0, Math.min(crop.y, exifHeight - 1));
|
|
4489
|
+
const cropWidth = Math.min(crop.width, exifWidth - cropX);
|
|
4490
|
+
const cropHeight = Math.min(crop.height, exifHeight - cropY);
|
|
4491
4491
|
let pipeline = sharp7(exifCorrectedBuffer);
|
|
4492
4492
|
if (cropX > 0 || cropY > 0 || cropWidth < exifWidth || cropHeight < exifHeight) {
|
|
4493
|
-
if (cropX + cropWidth > exifWidth || cropY + cropHeight > exifHeight) {
|
|
4494
|
-
return jsonResponse(
|
|
4495
|
-
{ error: `Invalid crop area: ${cropX},${cropY} ${cropWidth}x${cropHeight} exceeds image ${exifWidth}x${exifHeight}` },
|
|
4496
|
-
{ status: 400 }
|
|
4497
|
-
);
|
|
4498
|
-
}
|
|
4499
4493
|
pipeline = pipeline.extract({
|
|
4500
|
-
left: cropX,
|
|
4501
|
-
top: cropY,
|
|
4502
|
-
width: cropWidth,
|
|
4503
|
-
height: cropHeight
|
|
4494
|
+
left: Math.round(cropX),
|
|
4495
|
+
top: Math.round(cropY),
|
|
4496
|
+
width: Math.round(cropWidth),
|
|
4497
|
+
height: Math.round(cropHeight)
|
|
4504
4498
|
});
|
|
4505
4499
|
}
|
|
4506
4500
|
if (rotation !== 0) {
|
|
@@ -4693,15 +4687,7 @@ async function startServer(options) {
|
|
|
4693
4687
|
);
|
|
4694
4688
|
app.post("/api/studio/delete", wrapHandler(handleDelete));
|
|
4695
4689
|
app.post("/api/studio/delete-stream", wrapHandler(handleDeleteStream, true));
|
|
4696
|
-
app.use(express.static(join(workspace, "public")
|
|
4697
|
-
etag: false,
|
|
4698
|
-
lastModified: false,
|
|
4699
|
-
setHeaders: (res) => {
|
|
4700
|
-
res.setHeader("Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate");
|
|
4701
|
-
res.setHeader("Pragma", "no-cache");
|
|
4702
|
-
res.setHeader("Expires", "0");
|
|
4703
|
-
}
|
|
4704
|
-
}));
|
|
4690
|
+
app.use(express.static(join(workspace, "public")));
|
|
4705
4691
|
const clientDir = resolve(__dirname, "../client");
|
|
4706
4692
|
app.get("/", (req, res) => {
|
|
4707
4693
|
const htmlPath = join(clientDir, "index.html");
|
|
@@ -4718,15 +4704,7 @@ async function startServer(options) {
|
|
|
4718
4704
|
res.status(404).send("Client not built. Run npm run build first.");
|
|
4719
4705
|
}
|
|
4720
4706
|
});
|
|
4721
|
-
app.use(express.static(clientDir
|
|
4722
|
-
etag: false,
|
|
4723
|
-
lastModified: false,
|
|
4724
|
-
setHeaders: (res) => {
|
|
4725
|
-
res.setHeader("Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate");
|
|
4726
|
-
res.setHeader("Pragma", "no-cache");
|
|
4727
|
-
res.setHeader("Expires", "0");
|
|
4728
|
-
}
|
|
4729
|
-
}));
|
|
4707
|
+
app.use(express.static(clientDir));
|
|
4730
4708
|
const title = `Gallop - Studio (${version})`;
|
|
4731
4709
|
app.listen(port, () => {
|
|
4732
4710
|
console.log(`
|