How to add a tag to a ZIP file?

Started by biEnvEAm, November 14, 2019, 07:36:53 AM

Previous topic - Next topic

biEnvEAm

Hi guys,
I'm looking to add a certain piece of information to a ZIP file, a string, in example:

tag name: acm_version
tag value: 4.1.0.23

I understand that ExifTool can't write ZIP tags (ZipBitFlag, ZipCompressedSize, etc') but I take it ExifTool can write other types of tags on a ZIP file, is that correct? will that let me add this information to a ZIP file?

Thanks

Phil Harvey

I think the thing to do would be create an XMP file containing the metadata you want (maybe with a name "_metadata.xmp" or something like that), and add it to the ZIP file.  You can use ExifTool to create the XMP file, and any zip app to add it to the archive.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

All the tags exiftool shows for a zip file are actually properties of the file in the same way that an image file has an image size and video files have a duration.  They're not things that can be edited without fundamentally changing the file itself.

Now, zip files do allow for comments to be added to a zip file, though exiftool doesn't display these.  Using WinRar you can add a comment to the whole file.  You access it under Commands menu->Add Archive Comment or hit Alt-M.

7Zip does it differently.  It allows you to add a comment to each individual file in the archive, but it does it by creating a file called "descript.ion" in the archive.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Hi StarGeek,

Could you send me a small zip file with a comment added?  I would like to look into this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Here is a zip file and a rar file and example output from 7zip that shows the comments.

7-Zip 18.05 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-04-30

Scanning the drive for archives:
1 file, 191 bytes (1 KiB)

Listing archive: C:\text.zip

--
Path = C:\text.zip
Type = zip
Physical Size = 191
Comment = This is a ZIP comment.

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2019-11-14 09:31:11 ....A           19           19  text.txt
------------------- ----- ------------ ------------  ------------------------
2019-11-14 09:31:11                 19           19  1 files


7-Zip 18.05 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-04-30

Scanning the drive for archives:
1 file, 136 bytes (1 KiB)

Listing archive: C:\text.rar

--
Path = C:\text.rar
Type = Rar5
Physical Size = 136
Solid = -
Blocks = 1
Encrypted = -
Multivolume = -
Volumes = 1
Comment = This is a RAR comment.

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2019-11-14 09:31:11 ....A           19           19  text.txt
------------------- ----- ------------ ------------  ------------------------
2019-11-14 09:31:11                 19           19  1 files
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Thanks.  I'll take a look at this when I get a chance.

- Phi
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

It's not used very often.  While 7zip can read the comments, it doesn't have the ability to write it.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).