Closed leknoppix closed 8 years ago
Could you upload the jpeg?
I use this but, I think that is not correct: var jpeg = fs.readFileSync(file); var data = jpeg.toString("binary"); piexifjs.remove(data);
EDIT: I this I have found a solution:
var jpeg = fs.readFileSync(file);
var data = jpeg.toString("binary");
data = piexifjs.remove(data);
var newJpeg = new Buffer(data, "binary");
fs.writeFileSync(file + ".test.jpg", newJpeg);
It means solved?
Yes and No. When I use a picture without EXIF, i obtin Uncaught Exif not found.
A idea?
No error ocured.
var piexif = require("piexifjs");
var fs = require("fs");
var filename1 = "in.jpg";
var jpeg = fs.readFileSync(filename1);
var data = jpeg.toString("binary");
var new = piexif.remove(data);
use "try catch".
Thank
This's the answer to the question : https://github.com/hMatoba/Piexif/issues/30#issuecomment-275818092 Thumbnail information is wrong. If a jpeg has thumbnail, it must have 1st IFD and JPEGInterchangeFormatLength in Exif IFD(exif["Exif"][piexif.ExifIFD.JPEGInterchangeFormatLength]) value. JPEGInterchangeFormatLength means byte size of thumbnail. Your image has thumbnail's information, but it shows thumbnail's size as byte is zero, so remove thumbnail's information.
del exif["1st"] del exif["thumbnail"] piexif.dump(exif)
Hello
i will try to use the function remove, but i have an error when I choose a picture. I use like this:
var piexifjs = require('piexifjs'); piexifjs.remove(file);
Where file is mypicture: "C:\Users\leknoppix\Pictures\10 ans bac 2005\P1050914 - Copie.jpeg"The console.log give this to return: Given data is not jpeg.
I don't understand where is the problem. I think that is me but I don't look the solve.