Preserve Exif Data
See original GitHub issueExpected Behavior
Image is being saved with a horizontal and vertical resolution of 96 dpi, even though the input image is 1 dpi. The Resolution Unit also doesn’t appear to be saved.
Current Behavior
Jimp is setting its own values, regardless of the input image. There doesn’t appear to be a way to change these settings either.
Failure Information (for bugs)
I would expect the meta data to remain the same when saving an image from an input image, but it doesn’t appear so.
Steps to Reproduce
var jimp = require('jimp');
const fs = require('fs');
jimp.read('image.jpg', (err, img1) => {
if (err) throw err;
const debugOut = JSON.parse(JSON.stringify(img1));
debugOut.bitmap.data = [];
fs.writeFile('data.txt', JSON.stringify(debugOut, null, 4), (err3) => {
if (err3) throw err;
});
img1.write('OUTPUT.JPG');
});
Context
I’m working with equirectangular images and creating a script to stitch images together from a Yi VR camera. It is paramount that the metadata stays intact for the images otherwise they can’t be stitched. Images can be manually edited in paint, but I it would go much faster if I can automate it. Jimp seems to be ignoring the metadata for an image, no matter what I set it to:
img1._exif.XResolution = 1;
img1._exif.YResolution = 1;
- Jimp Version: 0.3.5
- Operating System: Windows 10
- Node version: 8.9.4
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top GitHub Comments
PRs welcome! I’m gonna investigate moving just the bytes over as that seems like it could work well. I’ll probably get to it later this week
@Slyke this is probably an issue with https://github.com/eugeneware/jpeg-js. I have an issue open to encode exif data here. The DPI issue seems different though, you might want to open another issue there.
I might try to pursue this on my own, but I don’t know how easy it will be to add these features to jpeg-js.