-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip media metadata. #2907
Strip media metadata. #2907
Conversation
kCGImagePropertyJFIFDictionary as String : kCFNull, | ||
kCGImagePropertyPNGDictionary as String : kCFNull, | ||
kCGImagePropertyIPTCDictionary as String : kCFNull, | ||
kCGImagePropertyMakerAppleDictionary as String : kCFNull |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Color profiles are preservd.
There was a problem hiding this comment.
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.
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? |
@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
657dbde
to
a621133
Compare
@michaelkirk done :) |
In d9b8ce2. Thanks! |
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