edit-meta: remove undef orientation

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/1010/head
Varun Patil 2024-01-10 15:41:38 -08:00
parent 3ab5c21970
commit ea540e1434
1 changed files with 1 additions and 10 deletions

View File

@ -232,7 +232,7 @@ export default defineComponent({
// Orientation
const orientation = this.refs.editOrientation?.result?.(p);
if (orientation !== null) {
if (orientation !== null && orientation !== undefined) {
raw.Orientation = orientation;
}
@ -273,15 +273,6 @@ export default defineComponent({
try {
// Update EXIF if required
const raw = exifs.get(fileid) ?? {};
// Remove undefined keys
for (const key in raw) {
if ((raw as any)[key] === undefined) {
delete (raw as any)[key];
}
}
// Save EXIF if required
if (Object.keys(raw).length > 0) {
const info = await axios.patch<IImageInfo>(API.IMAGE_SETEXIF(fileid), { raw });
dirty = true;