Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jan 3, 2018

  • removes non-orientation metadata from image and video attachments
  • option to disable the feature

Description

Strips non-orientation metadata from image and video attachments, with an option to leave the metadata in. This was tested by printing out the metadata dictionaries before and after the modification, as well as checking the attachment on a secondary device to make sure the information was truly removed.

All attachments flow through the SignalAttachment class. Images flow through the imageAttachment method of that class which strips out the metadata. I noticed that the master branch has been updated so that all video attachments are piped through the compressVideoAsMp4 inside the SignalAttachment class, so removal of video metadata was implemented there.

Fixes #1984

Copy link
Contributor

@charlesmchen charlesmchen Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things to test

  • Orientation is preserved.
  • GIF timing is preserved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Color profiles are preservd.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I just re-tested that the color space and profile, as well as orientation is preserved.

After stripping the data, these fields are left, for example:

([{TIFF}: {
Orientation = 1;
ResolutionUnit = 2;
XResolution = 72;
YResolution = 72;
}, PixelWidth: 3264, {Exif}: {
ColorSpace = 1;
PixelXDimension = 3264;
PixelYDimension = 2448;
}, PixelHeight: 2448, {JFIF}: {
DensityUnit = 0;
JFIFVersion =     (
    1,
    0,
    1
);
XDensity = 72;
YDensity = 72;
}, ProfileName: sRGB IEC61966-2.1, DPIWidth: 72, DPIHeight: 72, ColorModel: RGB, Orientation: 1, Depth: 8])

Timing looks good even with the iOS 11 live photo "GIF" movies that can be sent.

@michaelkirk
Copy link
Contributor

Hey @collinstuart - we had a rather large release backlogged, but now that it's out, we'd like to test this and get it merged. Can you rebase?

@ghost
Copy link
Author

ghost commented Feb 27, 2018

@michaelkirk - sure, I should be able to get to that today!

- removes non-orientation metadata from image and video attachments

- option to disable the feature

// FREEBIE
@ghost ghost force-pushed the collinstuart/strip-exif-data branch from 657dbde to a621133 Compare February 27, 2018 19:16
@ghost
Copy link
Author

ghost commented Feb 27, 2018

@michaelkirk done :)

@michaelkirk-signal
Copy link
Contributor

In d9b8ce2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SECURITY ISSUE: Signal doesn't strip EXIF from sent images, including precise location data

4 participants