Page 1 of 1

osx, command line and making pngs

Posted: Tue Aug 07, 2007 1:31 pm
by seanth
Hi-

I have a number of cfdg files (over 100 files) that I want to make into pngs so I can make an animation. With OSX, is there a way to pass arguments to context free to tell it to render a given .cfdg file to a .png?

Edit:

Essentially I am trying to do this with osx vs other *nixs:
cfdg ziggy_flowers.cfdg -z -a 20 output.png
(found this in another thread)

Posted: Wed Aug 08, 2007 5:04 pm
by MtnViewJohn
If you have XCode installed then you should be able to cd to the directory with the source tree and type 'make cfdg'.

Success!

Posted: Wed Aug 22, 2007 10:22 pm
by dz79
I've been trying to do this, too, as I'd like to be able to script creating PNGs in bulk. It took my a while to figure out how to do this. It wasn't quite as simple as MtnViewJohn makes it out to be ;)

(I did have XCode pre-installed.)

First, I used DarwinPorts (now MacPorts) to install libpng:

Code: Select all

sudo port install libpng 
--->  Fetching zlib
--->  Attempting to fetch zlib-1.2.3.tar.bz2 from http://www.zlib.net/
--->  Verifying checksum(s) for zlib
--->  Extracting zlib
--->  Applying patches to zlib
--->  Configuring zlib
--->  Building zlib with target all
--->  Staging zlib into destroot
--->  Installing zlib 1.2.3_1
--->  Activating zlib 1.2.3_1
--->  Cleaning zlib
--->  Fetching libpng
--->  Attempting to fetch libpng-1.2.18.tar.bz2 from http://downloads.sourceforge.net/libpng
--->  Verifying checksum(s) for libpng
--->  Extracting libpng
--->  Configuring libpng
--->  Building libpng with target all
--->  Staging libpng into destroot
--->  Installing libpng 1.2.18_0+darwin_8
--->  Activating libpng 1.2.18_0+darwin_8
--->  Cleaning libpng
Then I edited the "Makefile" so that the line

Code: Select all

       $(LINK.o) $^ -L/usr/local/lib -lstdc++ -lpng -lz -fexceptions -o $@
now reads

Code: Select all

        g++ $^ -L/usr/local/lib -lstdc++ -L/opt/local/lib -lpng -lz -fexceptions -o $@
And I edited the file "src-unix/pngCanvas.cpp" such that the line

Code: Select all

#include "png.h"
became

Code: Select all

#include "/opt/local/include/libpng12/png.h"
Everything was hunky dory then...

Yeah! Tight!