Hey Nate!
Thanks so much for the reply, and for the script :sun:
I tried with TweakPNG to exctract the content of one monster image... my suspicions were right, the part of the file that stores the actual image is just a microscopical part, worth in this case just 63KB, totally normal size.
The abomination occurs just before that, and is a text type of data.
It's such a long text string, that even trying to open, copy or paste it to read makes the PC struggle. I managed to paste it in a text editor, this is the beginning of the text:
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 6.0-c003 79.164527, 2020/10/15-17:48:32 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmp:CreatorTool="Adobe Photoshop 21.1 (Macintosh)" xmp:CreateDate="2020-04-01T14:10:33+02:00" xmp:MetadataDate="2021-02-20T12:39:53+01:00" xmp:ModifyDate="2021-02-20T12:39:53+01:00" photoshop:ColorMode="3" photoshop:ICCProfile="Display" dc:format="image/png" xmpMM:InstanceID="xmp.iid:414c3ea4-bf02-384d-aae5-84cc23663c00" xmpMM:DocumentID="adobe:docid:photoshop:1db3bbd0-6f5f-b248-82ea-13b6cdf3ab4f" xmpMM:OriginalDocumentID="xmp.did:c88f525a-6089-4966-8738-19df1ff99f47" tiff:Orientation="1" tiff:XResolution="720000/10000" tiff:YResolution="720000/10000" tiff:ResolutionUnit="2" exif:ColorSpace="65535" exif:PixelXDimension="1132" exif:PixelYDimension="939">
<photoshop:DocumentAncestors>
<rdf:Bag>
<rdf:li>0</rdf:li>
<rdf:li>0000A6C7815905497C2762FB3073AC1B</rdf:li>
<rdf:li>00017C97C28B0C407DB5E9F93F00B063</rdf:li>
<rdf:li>000265C8AD52E62C75E64BBFC28B1C06</rdf:li>
<rdf:li>0002B2CA935E4B47910AC9252E59DC68</rdf:li>
<rdf:li>0003C8770168CFEB622F1A6523EA33CE</rdf:li>
<rdf:li>0004823E764D76354AA10DA511016E79</rdf:li>
<rdf:li>00057A1D9F9E6ECC2921B9FF3044122A</rdf:li>
...
I put some new lines just for readability purpose, the original text is on one single line.
That list of <rdf:li> goes on forever, for such a high number of times that I think it has 0 to do with the actual image itself, it looks longer than the longest Fantasy saga ever written.
And at the end of the text part we find:
...
<rdf:li>xmp.id:FE7C5C7B47206811808399E50E9B1E6A</rdf:li>
<rdf:li>xmp.id:FE7F117407206811822A8003B198BBE4</rdf:li>
<rdf:li>xmp.id:FE7F1174072068118C14A6CF03B26B14</rdf:li>
<rdf:li>xmp.id:FF7F1174072068118C14F10C2D61E632</rdf:li>
<rdf:li>xmp.id:a6c80afd-7b22-4916-8169-6e466407c52a</rdf:li>
<rdf:li>xmp.id:ce2589c1-6db6-4c1e-aa4e-ad0e76710ff0</rdf:li>
</rdf:Bag>
</photoshop:DocumentAncestors>
<xmpMM:History>
<rdf:Seq>
<rdf:li stEvt:action="created" stEvt:instanceID="xmp.iid:c88f525a-6089-4966-8738-19df1ff99f47" stEvt:when="2020-04-01T14:10:33+02:00" stEvt:softwareAgent="Adobe Photoshop 21.1 (Macintosh)"/>
<rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:616bc4cb-b073-4430-92c4-0875b4c5a27f" stEvt:when="2020-04-01T14:12:30+02:00" stEvt:softwareAgent="Adobe Photoshop 21.1 (Macintosh)" stEvt:changed="/"/>
<rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:f37605a5-01db-1e4a-b564-b8b8569aebe3" stEvt:when="2021-02-20T12:39:52+01:00" stEvt:softwareAgent="Adobe Photoshop 22.1 (Windows)" stEvt:changed="/"/>
<rdf:li stEvt:action="converted" stEvt:parameters="from application/vnd.adobe.photoshop to image/png"/>
<rdf:li stEvt:action="derived" stEvt:parameters="converted from application/vnd.adobe.photoshop to image/png"/>
<rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:414c3ea4-bf02-384d-aae5-84cc23663c00" stEvt:when="2021-02-20T12:39:53+01:00" stEvt:softwareAgent="Adobe Photoshop 22.1 (Windows)" stEvt:changed="/"/>
</rdf:Seq>
</xmpMM:History>
<xmpMM:DerivedFrom stRef:instanceID="xmp.iid:f37605a5-01db-1e4a-b564-b8b8569aebe3" stRef:documentID="xmp.did:c88f525a-6089-4966-8738-19df1ff99f47" stRef:originalDocumentID="xmp.did:c88f525a-6089-4966-8738-19df1ff99f47"/>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="r"?>
I already use PNG Gauntlet to optimize PNGs, it does a good job but takes some time and manual inputs.
Alternatively to that small script you posted, would it be possible to modify my local copy of PStoSpine to make it try with Save For Web or Quick Export as PNG ?
If you just point me to a version of the script that used to have that, I can try to do it myself.
Thanks so much!