@gallop.software/studio 2.3.109 → 2.3.110
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 +8 -14
- 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) {
|