You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rotation works well, but it seems that the images lose resolution and drop from 600 dpi to 96 dpi.
Is there a way I can keep the original image's resolution while processing it?
I did, the density property did not seem to have any affect over the output file's x and y resolution.
I also looked in the output unit tests and tries to imitate the way the exif should have been dictated, but it didn't seem to work either.
Is this the proper way to describe the exif data?
Activity
lovell commentedon Dec 17, 2021
JPEG doesn't have a concept of resolution, but this image has EXIF metadata:
Please see https://sharp.pixelplumbing.com/api-output#withmetadata for control over this.
AdiLew commentedon Dec 18, 2021
I've tried adding the withMetadata() method, to keep all original exif like so, but it doesn't seem to work.
I've also tried dictating a hardcoded value for the X and Y resolution, as attached below, but the result is still 96dpi:
Is there a working example for retaining both of these values?
lovell commentedon Dec 20, 2021
Did you see the example at https://sharp.pixelplumbing.com/api-output#withmetadata
(I need to fix the formatting of this example in the docs as it's currently being displayed as part of the previous example.)
AdiLew commentedon Jan 1, 2022
I did, the density property did not seem to have any affect over the output file's x and y resolution.
I also looked in the output unit tests and tries to imitate the way the exif should have been dictated, but it didn't seem to work either.
Is this the proper way to describe the exif data?
lovell commentedon Apr 18, 2022
@AdiLew Were you able to make any progress with this? Did you try
.withMetadata({ density: 600 })?lovell commentedon May 3, 2022
Closing due to inactivity but please feel free to reopen with more details if further help is required.