szapp / heic-jpg-exif Goto Github PK
View Code? Open in Web Editor NEWConversion from HEIC to JPG while retaining essential EXIF metadata
Home Page: https://npmjs.com/package/heic-jpg-exif
License: MIT License
Conversion from HEIC to JPG while retaining essential EXIF metadata
Home Page: https://npmjs.com/package/heic-jpg-exif
License: MIT License
First of all awesome implementation, i had a lot of trouble where when i converted from heic to jpg/jpeg it just removed that underlying metadata (including the exif data).
However in your convert module you specify that this following logic rotates the image upright, but through different test it does not seem to do it. And i usually deal with quite a lot of heic images that are rotated differently, and we want to store the image in it's "correct orientation"
// Conversion rotates the image upright if (ifd0[piexif.TagValues.ImageIFD.Orientation] > 4) { const xd = exif[piexif.TagValues.ExifIFD.PixelXDimension] const yd = exif[piexif.TagValues.ExifIFD.PixelYDimension] exif[piexif.TagValues.ExifIFD.PixelXDimension] = yd exif[piexif.TagValues.ExifIFD.PixelYDimension] = xd ifd0[piexif.TagValues.ImageIFD.Orientation] = 1 }
This is my implementation:
if (fileExtension === "heic") { const outBuffer = await convert(file.buffer, undefined, 0.7); fileObj = { originalname: file.originalname, buffer: outBuffer, }; }
Thank you very much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.