lovell / avif-cli

Command line utility to convert images to AVIF
Apache License 2.0
175 stars 18 forks source link

Enhancement: add support for passing through metadata, including EXIF orientation #13

Closed 3xploiton3 closed 9 months ago

3xploiton3 commented 1 year ago

https://sharp.pixelplumbing.com/changelog#v0313---21st-december-2022

lovell commented 1 year ago

Hello, the current semver range is wide enough to include the latest version, so you might need to update your lockfile e.g. via npm upgrade or similar.

https://github.com/lovell/avif-cli/blob/42f0dcc4ad5fcc963d28a8037c7873a91f6c0d86/package.json#L28

3xploiton3 commented 1 year ago

thanks it work, but little problem here

i tried compress this image result image become rotated to landscape,

image

command: npx avif --quality=30 --verbose

lovell commented 1 year ago

This input image is landscape and contains an EXIF Orientation that results in some software rotating it by 90 degrees clockwise.

I guess we'll need to either add a command line flag to rotate e.g. --auto-orient, or a flag to pass through all metadata e.g. --with-metadata, which would use withMetadata(). I think the latter might be more useful as this will include XMP etc.

I'll label this as a future possible enhancement. Happy to accept a PR, if you're able.

lovell commented 9 months ago

The --keep-metadata flag, which takes advantage of the new keepMetadata feature of sharp v0.33.0+, was added via commit https://github.com/lovell/avif-cli/commit/30e7c5f3e30a81541f0b0571b9439c485ae6982d and released in avif v0.5.2.