Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Created May 12, 2010 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberShadow/399071 to your computer and use it in GitHub Desktop.
Save CyberShadow/399071 to your computer and use it in GitHub Desktop.
module AddPNGChunk;
import std.file;
import Data, PNG;
void main(string[] args)
{
if (args.length != 4)
throw new Exception("Usage: AddPNGChunk Image.png ChunkID Filename.ext");
auto png = new PNG(readData(args[1]));
png.chunks = png.chunks[0..$-1] ~ PNGChunk(args[2], readData(args[3])) ~ png.chunks[$-1];
write(args[1], png.compile.contents);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment