Skip to content
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

Exif support #2

Open
dbtsai opened this issue Jul 9, 2021 · 7 comments
Open

Exif support #2

dbtsai opened this issue Jul 9, 2021 · 7 comments

Comments

@dbtsai
Copy link

dbtsai commented Jul 9, 2021

Does it copy the exif and color space metadata to jpeg xl from the original input?

@olokelo
Copy link
Owner

olokelo commented Jul 9, 2021

Hi,
Unfortunately for now that's not the case.
You can see what's currently supported and what isn't in the table in the bottom of README.
I couldn't find any way to add Exif metadata from high level libjxl api.
I will be really grateful if someone smarter than me could figure out how to do it...

@dbtsai
Copy link
Author

dbtsai commented Jul 9, 2021

Just figure that out. Maybe it's possible to add exif/color profile metadata using exiftool after the jpeg xl file is created.

@olokelo
Copy link
Owner

olokelo commented Jul 9, 2021

Oh really! It appears to be working fine.
Mine ExifTool version is 12.26.
This adds tag "rights" with value "AAA" into containerized JXL file.

$ exiftool -rights="AAA" a.jxl

It's also possible to copy all tags from one image to another.
So probably that's a workaround for now but I really wanted to do that without external dependencies, it must be possible since cjxl does it but it's using entirely different api methods to do that.

@dbtsai
Copy link
Author

dbtsai commented Jul 9, 2021

Awesome. Good to know it's working.

I don't see that cjxl will handle those colorspace or metadata as it's purely a compression/decompression codec. ImageMagick internally also uses exiftool to handle those metadata as far as I know. For lossless compression, it will be very nice that you can have a mode to do bit-wise comparison with the original input image before deleting them.

@olokelo
Copy link
Owner

olokelo commented Jul 9, 2021

I mean AFAIK cjxl supports copying Exif and XMP tags from original input into jxl container.
It does that automatically if metadata is detected in source image.
I'm not a JPEG XL developer so I have little idea on how things work internally but I've been experimenting with it for a while.

@dbtsai
Copy link
Author

dbtsai commented Jul 9, 2021

Get it.

@alexjc
Copy link
Contributor

alexjc commented Nov 25, 2022

Adding to this, you may need to use the -m flag so it adds the container if it's not present. For instance, I use this:

exiftool -m -artist="<PERSON>" -copyright="cc-by-nc-4.0 <ORGANIZATION>, 2022." -overwrite_original *.jxl

As for "copying from the original input", do you mean PIL Images in this case?
https://stackoverflow.com/questions/17042602/preserve-exif-data-of-image-with-pil-when-resizecreate-thumbnail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants