Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bridge bug - ICC profile in PNG file deleted

LEGEND ,
Aug 20, 2021 Aug 20, 2021

Bridge incorrectly alters the metadata in PNG files to remove the ICC profile tag after purging cache.

 

Steps to reproduce:

 

Bridge 11.1.1, Photoshop 22.5, Windows 10 Pro 21H1

 

1. Save a PNG file from Photoshop with ICC profile embedded.

2. View in Bridge, File Info->Raw Data

3. Right click->Purge cache for selection

4. View in Bridge, File Info->Raw Data

 

Expected: ICC profile tag intact

Actual: ICC profile tag removed

 

Note that when opened in Photoshop, PS File Info shows the ICC profile tag intact and PS correctly identifies the profile.

 

Example screenshots before/after cache purge. This is a PNG file with profile saved in Photoshop 22.5. Also tested with a Bridge script that writes the XMP tag to file metadata.

 

Screenshot 2021-08-20 102723.pngScreenshot 2021-08-20 102816.png

 

For completeness, this Bridge script will add an ICC profile to PNG files:

 

 

 

#target bridge

main()

function main(){
    try{
        if(app.document.selectionLength > 0){ //test for no selection
           var thumbs = app.document.getSelection('png'); //get selected files of enumerated types
            }
        else{
            alert('No files selected! Please select supported image files to enable export.');
            thumbs = null;
            return;
            }
        if(thumbs.length != 0){ //are any valid files selected
            if(ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); //load library for metadata
            var fileMeta = thumbs[0].synchronousMetadata; //new metadata object
            var xmp = new XMPMeta(fileMeta.serialize());
            for(var a = 0; a < thumbs.length; a++){
                fileMeta = thumbs[a].synchronousMetadata; //new metadata object
                xmp = new XMPMeta(fileMeta.serialize());
                xmp.setProperty('http://ns.adobe.com/photoshop/1.0/', 'ICCProfile', 'sRGB IEC61966-2.1', 0); //set ICC profile tag
                var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT); //write updated XMP
                thumbs[a].metadata = new Metadata(updatedPacket); //save to file
                }
            }
        }
    catch(e){
        alert(e + ' ' + e.line);
        }
    }

 

 

TOPICS
Bug , Metadata , Problem or error
131
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation