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

Metadata #169

Open
IdfbAn opened this issue Mar 20, 2025 · 3 comments
Open

Metadata #169

IdfbAn opened this issue Mar 20, 2025 · 3 comments

Comments

@IdfbAn
Copy link

IdfbAn commented Mar 20, 2025

I'm looking at the TODO, and I'm a bit confused on what some stuff means.

First, by "metadata", I assume you mean stuff like EXIF? If I download this, for example, and then compress it, the EXIF is gone. Again, I assume this is what you mean? CMIIW, though.

Second, this:

When both metadata and data are wanted in the same .xz file, two or more Streams would be concatenated.

Going back to my image example, if an .xz file has just one Stream, does that mean it's only either just the image without the EXIF, or just the EXIF without the actual image?

Thanks.

@Larhzu
Copy link
Member

Larhzu commented Mar 25, 2025

Metadata means an ability to add something extra that doesn't affect normal decompression of the file. For example, one could store freeform file description or comment, or cryptographic signature of the contents. There are different possible uses. The .gz format has special fields for the original filename and timestamp, and the format supports also custom metadata.

I don't understand your EXIF example. EXIF is metadata about the image, so in that sense the comparison is spot on. But compression doesn't delete the EXIF from the file. If EXIF is missing after some operation, it's because the operation removed it.

When both metadata and data are wanted in the same .xz file, two or more Streams would be concatenated.

Going back to my image example, if an .xz file has just one Stream, does that mean it's only either just the image without the EXIF, or just the EXIF without the actual image?

If metadata was implemented as its own Stream type, then it's as you wrote. Normal .xz files can have more than one Stream, so such a metadata implementation would allow .xz files to have both data and metadata at the same time.

@IdfbAn
Copy link
Author

IdfbAn commented Mar 25, 2025

Metadata means an ability to add something extra that doesn't affect normal decompression of the file. For example, one could store freeform file description or comment, or cryptographic signature of the contents.

How would this metadata be added? A command-line argument, I assume?

@Larhzu
Copy link
Member

Larhzu commented Mar 25, 2025

A new command line argument is one way. For example, --metadata=KEY=VALUE so one could say xz --metadata=mime_type=text/plain foo.txt or something like that. I haven't thought about it much even though the metadata idea existed well before XZ Utils 5.0.0. It's just one of the missing features.

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

2 participants