-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Unable to write GPS Exif Metadata #3633
Comments
EXIF stores GPS metadata in |
Thanks for the quick reply. I have changed the example according to the referenced issue: image.withMetadata({
exif: {
IFD0: {
Make: 'TestMake',
Model: 'TestModel'
},
IFD3: {
GPSLatitudeRef: 'N',
GPSLatitude: '55/1 43/1 5287/100',
GPSLongitudeRef: 'E',
GPSLongitude: '37/1 35/1 5571/100',
GPSAltitudeRef: 'Sea level',
GPSAltitude: '90514/693',
GPSSpeedRef: 'K',
GPSSpeed: '114272/41081',
GPSImgDirectionRef: 'M',
GPSImgDirection: '192127/921',
GPSDestBearingRef: 'M',
GPSDestBearing: '192127/921',
GPSDateStamp: '2020:07:28'
}
}
}); Using sharp again to parse the processed image and then parsing the raw exif data results in the expected output. 😃 Thanks for the guidance - I had trouble finding any reference to this issue. I suggest adding a quick link / some information where to search (if there is external documentation available) to the documentation of the withMetadata function. Providing types for the IFDX parameters would be awesome if possible. |
Commit d6b60a6 updates the documentation to add an EXIF GPS example, thanks for the suggestion. Happy to accept a PR to improve the TypeScript definitions, if you're able. |
I have found the following: These type definitions seem to be providing some help for the IFD0 values. |
Modify Metadata - GPS Exif Metadata
What are you trying to achieve?
I am trying to add geo location data to an existing image without this information.
One example is taking a screenshot and adding exif data with the
withMetadata
method.When you searched for similar issues, what did you find that might be related?
I have found several discussions and issues about the metadata and the development from using other libraries to using sharp itself.
This allowed me to find several samples that work with common exif data, e.g.
Make
orModel
.I have found the related documentation here: https://sharp.pixelplumbing.com/api-output#withmetadata
Code Sample
I have tried to process an image with existing location data.
The information is not lost after processing with
image.withMetadata().toBuffer()
.I think I am probably not passing the right arguments to the
withMetadata
call but I am unable to find similar issues or further documentation.Any help is appreciated.
The text was updated successfully, but these errors were encountered: