fix: reuse source url for product lock mask edits

This commit is contained in:
134 2026-07-07 20:24:05 +08:00
parent c60a3bb226
commit 6b70865235

View File

@ -3889,16 +3889,10 @@ async function createScaleAdjustPatchReference(params: {
if (params.fullFrameReferenceOnly && structureLockAppliedRef.value) {
if (
params.minimalProductLockMaskEditReferences &&
sourceImageUrl &&
targetDraftReference.productLockOverlayBuffer &&
targetDraftReference.productLockEditMaskBuffer
) {
const sourceFullBuffer = await sharp(sourceBuffer, { failOn: "none" })
.png({ compressionLevel: 6 })
.toBuffer();
const sourceFullUpload = await uploadFile(
`canvas-scale-adjust-source-full-${suffix}.png`,
toArrayBuffer(sourceFullBuffer)
);
const productLockOverlayUpload = await uploadFile(
`canvas-scale-adjust-product-lock-overlay-${suffix}.png`,
toArrayBuffer(targetDraftReference.productLockOverlayBuffer)
@ -3929,11 +3923,11 @@ async function createScaleAdjustPatchReference(params: {
productLockFalEditMaskUrl: productLockFalEditMaskUpload?.url || null,
productLockOverlayUrl: productLockOverlayUpload.url,
productLockProtectMaskUrl: productLockProtectMaskUpload?.url || null,
sourceCropUrl: sourceImageUrl || sourceFullUpload.url,
sourceFullUrl: sourceFullUpload.url,
sourceCropUrl: sourceImageUrl,
sourceFullUrl: sourceImageUrl,
structureLockedDraft: structureLockAppliedRef.value,
targetDraftFullUrl: sourceImageUrl || sourceFullUpload.url,
targetDraftUrl: sourceImageUrl || sourceFullUpload.url,
targetDraftFullUrl: sourceImageUrl,
targetDraftUrl: sourceImageUrl,
workspacePixelRect,
workspaceRect,
};