Skip to content
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

Removing thumbnail from EXIF data #14

Closed
svenbluege opened this issue Aug 12, 2016 · 2 comments
Closed

Removing thumbnail from EXIF data #14

svenbluege opened this issue Aug 12, 2016 · 2 comments
Labels

Comments

@svenbluege
Copy link

Hi,

I try to remove the embedded thumbnail from the EXIF data or replace it with a empty thumbnail with code like this:

var jpeg = image.buffer;
var data = jpeg.toString("binary");
var exifObj = piexif.load(data);
exifObj["0th"][piexif.ImageIFD.Model] = "FOOBAR 2";
exifObj['thumbnail'] = null;
var exifbytes = piexif.dump(exifObj);
var newData = piexif.insert(exifbytes, data);
var newJpeg = new Buffer(newData, "binary");

Unfortunately the thumbnail stays in the resulting image files. Can you give me any hint on what I'm doing wrong here?

@hMatoba
Copy link
Owner

hMatoba commented Aug 16, 2016

Don't use null as value.

delete exifObj["1st"];
delete exifObj['thumbnail'];

@svenbluege
Copy link
Author

nice! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants