Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] PNG examiner

From: reboldes::bigfoot::com at: 2-Sep-2000 6:44

--__REBOL--2.2.0.3.1--2-Sep-2000/15:07:47+2:00--1895 Content-type: text/plain I want to create a script that will allow me to create or modify simple png files. I've started with this script, that parses all the standard "chunks" in the file, but I could not go through the CRC and compression (LZ77 derivate). Anybody want to help me? oldes PS: The PNG spec. I used: http://oldes.multimedia.cz/spec/REC-png.html --__REBOL--2.2.0.3.1--2-Sep-2000/15:07:47+2:00--1895 Content-Type: application/octet-stream; name="png.r" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="png.r" UmVib2wgWwoJdGl0bGU6ICJQTkcgRXhhbWluZXIiCglBdXRob3I6ICJvbGRlcyIKCURhdG U6ICAgIDMxLUF1Zy0yMDAwCgl2ZXJzaW9uOiAwLjAuMQogICAgRmlsZTogICAgJXBuZy5y CiAgICBFbWFpbDogICByZWJvbGRlc0BiaWdmb290LmNvbQogICAgSG9tZTogICAgaHR0cD ovL29sZGVzLm11bHRpbWVkaWEuY3ovcnVyL2Rvd25sb2FkLwoJUHVycG9zZTogewogICAg ICAgQmFzaWMgUE5HIChQb3J0YWJsZSBOZXR3b3JrIEdyYXBoaWNzKSBwYXJzZXIgd2hpY2 ggY2FuCgkgICBzaG93IGFsbCBpbmZvcm1hdGlvbnMgZnJvbSBzdGFuZGFyZCBjaHVua3Mg aW4gdGhlIGZpbGUuIAogICAgfQogICAgQ2F0ZWdvcnk6IFtmaWxlIHV0aWwgM10KCUhpc3 Rvcnk6IFsKCQkwLjAuMSBbMzEtQXVnLTIwMDAgIm9sZGVzIiAiSW5pdGlhbCB2ZXJzaW9u Il0KCV0KCWNvbW1lbnQ6IHtJIHdvdWxkIG5lZWQgYSBsaXR0bGUgaGVscCB3aXRoIENSQy BhbmQgY29tcHJlc3Npb24gdG8gYmUgYWJsZQoJY3JlYXRlL21vZGlmeSBteSBvd24g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aWZpZXI6ICIgZGF0YS8zICIoIiBwaWNrIFsidW5rbm93biIgIm1ldG VyIl0gKGRhdGEvMyArIDEpCiIpIl0KCQldCgkJInNCSVQiIFtwcmludCBbIlNpZ25pZmlj YW50IGJpdHM6IiBkYXRhXV0KCQkidEVYdCIgW3ByaW50IFtkYXRhLzEgIjoiIGRhdGEvMl 1dCgkJInRSTlMiIFtwcmludCBbIlRyYW5zcGFyZW5jeTpfX19fIiBkYXRhXV0KCQkielRY dCIgWwoJCQlwcmludCAiQ29tcHJlc3NlZCB0ZXh0dWFsIGRhdGE6IgoJCQlwcmludCBbIi AiIGRhdGEvMSBkYXRhLzIgZGF0YS8zXQoJCV0KCQkgIAoJXVsKCQllaXRoZXIgZmluZCBw bmcvY2h1bmstYnl0ZXMgdHlwZSBbCgkJCXByaW4gW3R5cGUgIiAiXSBwcm9iZSBkYXRhCg kJXVsJcHJpbnQgWyJOb25zdGFuZGFyZCIgZWl0aGVyICh0by1pbnRlZ2VyIHR5cGUvMikg PiA4OCBbInByaXZhdGUiXVsicHVibGljIl0gImNodW5rOiIgdHlwZV0KCQldCgldIApdCg oK --__REBOL--2.2.0.3.1--2-Sep-2000/15:07:47+2:00--1895 Content-Type: application/octet-stream; name="test.png" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.png" iVBORw0KGgoAAAANSUhEUgAAACQAAAAkAQMAAADbzgrbAAAAA3NCSVQICAjb4U/gAAAABl BMVEUA/2YAZgBC6Rq9AAAAAnRSTlP//8i138cAAAAJcEhZcwAADnQAAA50AWsks9YAAAAh dEVYdFNvZnR3YXJlAE1hY3JvbWVkaWEgRmlyZXdvcmtzIDIuMO6rW8cAAAAWdEVYdENyZW F0aW9uIFRpbWUAMDgvMzAvMDBqktPXAAAAHUlEQVR4nGP4DwQfGIgi9xOt8jvRKqHkexLV EyQBlYaw2TYxX2cAAAAASUVORK5CYI--__REBOL--2.2.0.3.1--2-Sep-2000/15:07:47+2:00--1895--