Created
May 12, 2010 20:09
-
-
Save CyberShadow/399071 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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