Cleanup after rotating images

This commit is contained in:
ayumi-signal 2024-01-04 11:34:53 -08:00 committed by GitHub
parent 238812382b
commit 0aad09682d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 1 deletions

View file

@ -78,10 +78,14 @@ export async function autoOrientJPEG(
// retain it but due to reports of data loss, we dont want to overburden IndexedDB
// by potentially doubling stored image data.
// See: https://github.com/signalapp/Signal-Desktop/issues/1589
// We also clear out the attachment path because we're changing
// the attachment data so it no longer matches the old path.
// Path and data should always be in agreement.
const xcodedAttachment = {
...attachment,
data: new Uint8Array(xcodedDataArrayBuffer),
size: xcodedDataArrayBuffer.byteLength,
path: undefined,
};
return xcodedAttachment;