Might not be JSONStringify-able

This commit is contained in:
Manav Rathi 2024-05-01 11:33:42 +05:30
parent 55c603d345
commit ff5a167f48
No known key found for this signature in database

View file

@ -167,14 +167,7 @@ function parseExifData(exifData: RawEXIFData): ParsedEXIFData {
parsedExif.imageWidth = ImageWidth;
parsedExif.imageHeight = ImageHeight;
} else {
log.error(
`Image dimension parsing failed - ImageWidth or ImageHeight is not a number ${JSON.stringify(
{
ImageWidth,
ImageHeight,
},
)}`,
);
log.warn("EXIF: Ignoring non-numeric ImageWidth or ImageHeight");
}
} else if (ExifImageWidth && ExifImageHeight) {
if (
@ -184,13 +177,8 @@ function parseExifData(exifData: RawEXIFData): ParsedEXIFData {
parsedExif.imageWidth = ExifImageWidth;
parsedExif.imageHeight = ExifImageHeight;
} else {
log.error(
`Image dimension parsing failed - ExifImageWidth or ExifImageHeight is not a number ${JSON.stringify(
{
ExifImageWidth,
ExifImageHeight,
},
)}`,
log.warn(
"EXIF: Ignoring non-numeric ExifImageWidth or ExifImageHeight",
);
}
} else if (PixelXDimension && PixelYDimension) {
@ -201,13 +189,8 @@ function parseExifData(exifData: RawEXIFData): ParsedEXIFData {
parsedExif.imageWidth = PixelXDimension;
parsedExif.imageHeight = PixelYDimension;
} else {
log.error(
`Image dimension parsing failed - PixelXDimension or PixelYDimension is not a number ${JSON.stringify(
{
PixelXDimension,
PixelYDimension,
},
)}`,
log.warn(
"EXIF: Ignoring non-numeric PixelXDimension or PixelYDimension",
);
}
}
@ -302,15 +285,13 @@ export function parseEXIFLocation(
);
return { latitude, longitude };
} catch (e) {
log.error(
`Failed to parseEXIFLocation ${JSON.stringify({
gpsLatitude,
gpsLatitudeRef,
gpsLongitude,
gpsLongitudeRef,
})}`,
e,
);
const p = {
gpsLatitude,
gpsLatitudeRef,
gpsLongitude,
gpsLongitudeRef,
};
log.error(`Failed to parse EXIF location ${JSON.stringify(p)}`, e);
return { ...NULL_LOCATION };
}
}