Strip Image Metadata (#2313)

This commit is contained in:
Daniel Gasienica 2018-04-30 19:06:26 -04:00 committed by GitHub
commit 3d147a3e21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -47,6 +47,8 @@ exports.isValid = rawAttachment => {
}; };
// Upgrade steps // Upgrade steps
// NOTE: This step strips all EXIF metadata from JPEG images as
// part of re-encoding the image:
exports.autoOrientJPEG = async attachment => { exports.autoOrientJPEG = async attachment => {
if (!MIME.isJPEG(attachment.contentType)) { if (!MIME.isJPEG(attachment.contentType)) {
return attachment; return attachment;

View file

@ -16,6 +16,8 @@ const PRIVATE = 'private';
// - Schema initialized // - Schema initialized
// Version 1 // Version 1
// - Attachments: Auto-orient JPEG attachments using EXIF `Orientation` data. // - Attachments: Auto-orient JPEG attachments using EXIF `Orientation` data.
// N.B. The process of auto-orient for JPEGs strips (loses) all existing
// EXIF metadata improving privacy, e.g. geolocation, camera make, etc.
// Version 2 // Version 2
// - Attachments: Sanitize Unicode order override characters. // - Attachments: Sanitize Unicode order override characters.
// Version 3 // Version 3