"Warning: No writable tags set from" from png to compress jxl file

Started by TheWonderAlmighty, April 23, 2024, 07:44:15 PM

Previous topic - Next topic

TheWonderAlmighty

I generated images with Stable Diffusion in PNG and am trying to convert them to jxl and keep their metadata, including date created, date modified times, and parameters. I converted all the images with this command

mogrify -format jxl 'fd -e png'
and When I do exiftool -a "00003-2214942706.png" I get this

ExifTool Version Number         : 12.76
File Name                       : 00003-2214942706.png
Directory                       : (ommitted)
File Size                       : 415 kB
File Modification Date/Time     : 2023:11:24 23:13:52-05:00
File Access Date/Time           : 2024:04:23 19:15:56-04:00
File Inode Change Date/Time     : 2024:04:23 19:15:55-04:00
File Permissions                : -rwx------
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 512
Image Height                    : 768
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Parameters                      : Negative prompt: fake.Steps: 50, Sampler: DPM++ SDE Karras, CFG scale: 7, Seed: 2214942706, Size: 512x768, Model hash: 1e0b0c6338, Model: amIReal_V4, VAE hash: 21ee2acc78, VAE: difconsistencyRAWVAE_v10LOWSafestensor.safetensors, ControlNet 0: "Module: none, Model: control_v11p_sd15_softedge [a8575a2a], Weight: 1, Resize Mode: Crop and Resize, Low Vram: False, Guidance Start: 0, Guidance End: 1, Pixel Perfect: False, Control Mode: Balanced, Save Detected Map: True", Version: v1.6.0
Image Size                      : 512x768
Megapixels                      : 0.393

It doesn't work when I try to copy to the compressed jxl file

exiftool -TagsFromFile "240423031406_00000.png" -all:all 240423031406_00000.jxl
Warning: No writable tags set from 240423031406_00000.png
    0 image files updated
    1 image files unchanged

StarGeek

As the response says, there aren't any tags in the PNG that can be written to the jxl file.

The only writable tag in the PNG, ignoring the file system ones, is the Parameters tag.  But that is a PNG only tags (see the PNG tags page). So that can't be copied directly with -all:all.

You will have to specifically copy that to some other tag that JXL supports, most likely an XMP tag. See the Supported File Types table.

Once you pick where you want to copy the tag, your command would be something like this, using the Description as an example
exiftool -TagsFromFile "240423031406_00000.png" "-Description<Parameters" 240423031406_00000.jxl
* 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).