compressorjs icon indicating copy to clipboard operation
compressorjs copied to clipboard

feat: add `retainExif` option to retain Exif

Open zcf0508 opened this issue 1 year ago • 4 comments

Summary

What kind of change does this PR introduce? (check at least one)

  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update
  • [ ] Refactor
  • [ ] Docs
  • [ ] Build-related changes
  • [ ] Other, please describe:

If changing the UI of the default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • [ ] Yes
  • [x] No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari
  • [ ] Edge
  • [ ] IE

If adding a new feature, the PR's description includes:

  • [x] A convincing reason for adding this feature
  • [x] Related documents have been updated
  • [x] Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

By default, the Exif information will be lost in the compressed image. If you want to keep the Exif information of the original image you can set the retainExif option to true

zcf0508 avatar Aug 30 '22 08:08 zcf0508

Is it necessary to add this feature? This is a question that requires careful consideration.

In fact, you can read Exif metadata on the browser side and upload it to the server side as a parameter along with the compressed image.

fengyuanchen avatar Sep 04 '22 05:09 fengyuanchen

@fengyuanchen Thanks for the reply. In my case, I use this lib to build a browser-side image compress website, I hope that the users can choose whether or not to retain the Exif when they save the compressed image.

zcf0508 avatar Sep 04 '22 05:09 zcf0508

Hey this feature will be very helpful. It can save a lot of time.

patilanz avatar Sep 05 '22 13:09 patilanz

@fengyuanchen I would like to ask for this feature to be merged too. Having the image and the metadata divided adds a few challenges, first of all keeping them linked and consistent.

lorenzomorandini avatar Oct 10 '22 09:10 lorenzomorandini

Indeed, it would be useful to at least have the option to chose since it doesn't impact the code to much

RokuDagy avatar Oct 11 '22 15:10 RokuDagy

I was looking for this feature and I would love to see this merged. If the purpose of this library is to compress images client-side, I don't see why you shouldn't have an option to keep the metadata.

Robert-Lebedeu avatar Oct 13 '22 07:10 Robert-Lebedeu