summaryrefslogtreecommitdiff
path: root/src/flam3-render.c
diff options
context:
space:
mode:
authorErik Reckase <e.reckase@gmail.com>2010-11-21 02:05:12 +0000
committerScott Draves <spot@draves.org>2015-02-15 12:20:13 -0500
commitb358966b64ccf5b25a8e5f92e0e2c15901454652 (patch)
tree8ac818cc3a30a64530bbc5ec17a6275cac0ae016 /src/flam3-render.c
parent26f5c53f097f58cbd11e00c30c31e1dfec3ece7b (diff)
downloadpucket-b358966b64ccf5b25a8e5f92e0e2c15901454652.tar.gz
pucket-b358966b64ccf5b25a8e5f92e0e2c15901454652.tar.bz2
pucket-b358966b64ccf5b25a8e5f92e0e2c15901454652.zip
16 bpc PNG images were not being written properly when strips were being used. while png_set_swap() is supposed to tell the system to reverse the order of the bits when writing the file, I was unable to get this to work, so I resorted to a brute-force reversal of the bits - but then forgot to put the bits BACK. This is not a problem for single strips, but with multiple strips things get very confused. png_set_swap would make this a non-issue.
git-svn-id: https://flam3.googlecode.com/svn/trunk@88 77852712-ef1d-11de-8684-7d64432d61a3
Diffstat (limited to 'src/flam3-render.c')
-rw-r--r--src/flam3-render.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/flam3-render.c b/src/flam3-render.c
index 11b69cf..7273fdb 100644
--- a/src/flam3-render.c
+++ b/src/flam3-render.c
@@ -295,7 +295,7 @@ int main(int argc, char **argv) {
if (last_size != -1)
free(image);
last_size = this_size;
- image = (void *) malloc(this_size);
+ image = (void *) calloc(this_size, sizeof(char));
if (NULL==image) {
fprintf(stderr,"Error allocating memory for image. Aborting\n");
exit(1);
@@ -351,7 +351,7 @@ int main(int argc, char **argv) {
sprintf(fname, "%s%05d.%s", prefix, i, format);
}
if (verbose) {
- fprintf(stderr, "writing %s...", fname);
+ fprintf(stderr, "writing %s...", fname);
}
fp = fopen(fname, "wb");
if (NULL == fp) {
@@ -381,8 +381,8 @@ int main(int argc, char **argv) {
fprintf(fp, "P6\n");
fprintf(fp, "%d %d\n255\n", cps[i].width, real_height);
if (this_size != fwrite((unsigned char *)image, 1, this_size, fp)) {
- perror(fname);
- }
+ perror(fname);
+ }
}
/* Free string */
free(fpc.genome);