[simage] 03/03: Add missing file.

Anton Gladky gladk at moszumanska.debian.org
Tue Sep 6 18:04:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository simage.

commit 214312836cc36fb3fcacf00228f0672493258932
Author: Anton Gladky <gladk at debian.org>
Date:   Tue Sep 6 20:02:24 2016 +0200

    Add missing file.
---
 debian/patches/10_change_stderr.patch | 198 ++++++++++++++++++++++++++++++++++
 1 file changed, 198 insertions(+)

diff --git a/debian/patches/10_change_stderr.patch b/debian/patches/10_change_stderr.patch
new file mode 100644
index 0000000..1d61c5e
--- /dev/null
+++ b/debian/patches/10_change_stderr.patch
@@ -0,0 +1,198 @@
+Description: Replace stderr by stdout in example.
+ Avoid output to stderr.
+Author: Anton Gladky <gladk at debian.org>
+Last-Update: 2016-09-06
+
+--- simage-1.7.1~2c958a6.dfsg.orig/examples/simage-convert.c
++++ simage-1.7.1~2c958a6.dfsg/examples/simage-convert.c
+@@ -28,7 +28,7 @@
+ static void
+ usage(const char * argv0)
+ {
+-  fprintf(stderr, "Usage:\n %s <infile> <outfile> [-newsize <x> <y>] [-scale <xmul> <ymul>] [-alphathreshold <val>] [-addalpha <filename>] [-setundef]\n",argv0);
++  fprintf(stdout, "Usage:\n %s <infile> <outfile> [-newsize <x> <y>] [-scale <xmul> <ymul>] [-alphathreshold <val>] [-addalpha <filename>] [-setundef]\n",argv0);
+ }
+ 
+ int main(int argc, char ** argv)
+@@ -124,30 +124,30 @@ int main(int argc, char ** argv)
+   else {
+     ext = strrchr(outfile, '.');
+     if (ext == NULL) {
+-      fprintf(stderr,"outfile has no valid extension\n");
++      fprintf(stdout,"outfile has no valid extension\n");
+       return -1;
+     }
+     else {
+       ext++; /* skip period */
+       if (!simage_check_save_supported(ext)) {
+-        fprintf(stderr,"Extension '%s' not supported for writing by simage\n",
++        fprintf(stdout,"Extension '%s' not supported for writing by simage\n",
+                 ext);
+         save = 0;
+       }
+     }
+   }
+ 
+-  fprintf(stderr,"read image: %s...", infile);
++  fprintf(stdout,"read image: %s...", infile);
+   buf = simage_read_image(infile, &w, &h, &nc);
+   if (buf) {
+-    fprintf(stderr,"done\n");
++    fprintf(stdout,"done\n");
+   }
+   else {
+-    fprintf(stderr,"Unable to read file\n", argv[1]);
++    fprintf(stdout,"Unable to read file\n", argv[1]);
+     return -1;
+   }
+ 
+-  fprintf(stderr,"image size: (%d, %d), components: %d\n",
++  fprintf(stdout,"image size: (%d, %d), components: %d\n",
+           w, h, nc);
+ 
+   if (xmul > 0.0f) {
+@@ -157,11 +157,11 @@ int main(int argc, char ** argv)
+   if (neww > 0 && newh > 0 && (neww != w || newh != h)) {
+     unsigned char * newbuf;
+ 
+-    fprintf(stderr,"resizing image: (%d, %d) to (%d %d)...",
++    fprintf(stdout,"resizing image: (%d, %d) to (%d %d)...",
+             w, h, neww, newh);
+     newbuf = simage_resize(buf, w, h, nc,
+                            neww, newh);
+-    fprintf(stderr,"done\n");
++    fprintf(stdout,"done\n");
+     simage_free_image(buf);
+     buf = newbuf;
+     w = neww;
+@@ -173,12 +173,12 @@ int main(int argc, char ** argv)
+     int ac;
+     int w2, h2, nc2;
+     unsigned char * buf2 = simage_read_image(addalpha, &w2, &h2, &nc2);
+-    fprintf(stderr,"alpha size: %d %d %d\n", w2, h2, nc2);
++    fprintf(stdout,"alpha size: %d %d %d\n", w2, h2, nc2);
+     if (buf2) {
+       if (w == w2 && h == h2 && (nc2 == 1 || nc2 == 2 || nc2 == 4)) {
+         unsigned char * dstbuf = buf;
+         if (nc == 1 || nc == 3) {
+-          fprintf(stderr,"adding alpha channel\n");
++          fprintf(stdout,"adding alpha channel\n");
+           dstbuf = (unsigned char*) malloc(w*h*(nc+1));
+           for (y = 0; y < h; y++) {
+             for (x = 0; x < w; x++) {
+@@ -193,7 +193,7 @@ int main(int argc, char ** argv)
+         if (nc2 == 2) ac = 1;
+         if (nc2 == 4) ac = 3;
+ 
+-        fprintf(stderr,"merging in alpha channel\n");
++        fprintf(stdout,"merging in alpha channel\n");
+         for (y = 0; y < h; y++) {
+           for (x = 0; x < w; x++) {
+             dstbuf[y*w*nc + x*nc + (nc-1)] = buf2[y*w*nc2 + x * nc2 + ac];
+@@ -205,11 +205,11 @@ int main(int argc, char ** argv)
+         }
+       }
+       else {
+-        fprintf(stderr,"Unable to add alpha channel\n");
++        fprintf(stdout,"Unable to add alpha channel\n");
+       }
+     }
+     else {
+-      fprintf(stderr,"Unable to read alpha file: %s\n", addalpha);
++      fprintf(stdout,"Unable to read alpha file: %s\n", addalpha);
+     }
+   }
+ 
+@@ -238,7 +238,7 @@ int main(int argc, char ** argv)
+       }
+       p++;
+     }
+-    fprintf(stderr,"alpha threshold changed %d pixels\n", cnt);
++    fprintf(stdout,"alpha threshold changed %d pixels\n", cnt);
+   }
+ 
+   if (gray && nc >= 3) {
+@@ -272,7 +272,7 @@ int main(int argc, char ** argv)
+       }
+       p += nc;
+     }
+-    fprintf(stderr,"undef'ed %d pixels\n", cnt);
++    fprintf(stdout,"undef'ed %d pixels\n", cnt);
+   }
+   if (mirrory) {
+     unsigned char * tmp = (unsigned char*) malloc(w*nc);
+@@ -288,15 +288,15 @@ int main(int argc, char ** argv)
+   }
+ 
+   if (save) {
+-    fprintf(stderr,"save image '%s'...", outfile);
++    fprintf(stdout,"save image '%s'...", outfile);
+     ret = simage_save_image(argv[2], buf, w, h, nc, ext);
+     simage_free_image(buf);
+     if (ret != 1) {
+-      fprintf(stderr,"error: %s\n", simage_get_last_error());
++      fprintf(stdout,"error: %s\n", simage_get_last_error());
+       return -1;
+     }
+     else {
+-      fprintf(stderr,"done\n");
++      fprintf(stdout,"done\n");
+     }
+   }
+   return 0;
+--- simage-1.7.1~2c958a6.dfsg.orig/examples/simage-read-line-test.c
++++ simage-1.7.1~2c958a6.dfsg/examples/simage-read-line-test.c
+@@ -28,7 +28,7 @@
+ static void
+ usage(const char * argv0)
+ {
+-  fprintf(stderr, "Usage:\n %s <infile>\n");
++  fprintf(stdout, "Usage:\n %s <infile>\n");
+ }
+ 
+ int main(int argc, char ** argv)
+@@ -48,7 +48,7 @@ int main(int argc, char ** argv)
+   image = s_image_open(argv[1], 1);
+ 
+   if (!image) {
+-    fprintf(stderr,"Unable to open file: %s\n" ,argv[1]);
++    fprintf(stdout,"Unable to open file: %s\n" ,argv[1]);
+     return -1;
+   }
+ 
+@@ -56,28 +56,28 @@ int main(int argc, char ** argv)
+   h = s_image_height(image);
+   nc = s_image_components(image);
+ 
+-  fprintf(stderr,"testing file: %s, %d %d %d\n", argv[1], w, h, nc);
++  fprintf(stdout,"testing file: %s, %d %d %d\n", argv[1], w, h, nc);
+ 
+   row = (unsigned char*) malloc(w*nc);
+ 
+-  fprintf(stderr,"testing step: %s, %d %d %d\n", argv[1], w, h, nc);
++  fprintf(stdout,"testing step: %s, %d %d %d\n", argv[1], w, h, nc);
+   for (i = 0; i < h; i += 146) {
+     if (!s_image_read_line(image, i, row)) {
+-      fprintf(stderr,"failed to read line %d\n", i);
++      fprintf(stdout,"failed to read line %d\n", i);
+     }
+   }
+ 
+-  fprintf(stderr,"testing normal: %s, %d %d %d\n", argv[1], w, h, nc);
++  fprintf(stdout,"testing normal: %s, %d %d %d\n", argv[1], w, h, nc);
+   for (i = 0; i < h; i++) {
+     if (!s_image_read_line(image, i, row)) {
+-      fprintf(stderr,"failed to read line %d\n", i);
++      fprintf(stdout,"failed to read line %d\n", i);
+     }
+   }
+ 
+-  fprintf(stderr,"testing backwards: %s, %d %d %d\n", argv[1], w, h, nc);
++  fprintf(stdout,"testing backwards: %s, %d %d %d\n", argv[1], w, h, nc);
+   for (i = h-1; i >=0; i--) {
+     if (!s_image_read_line(image, i, row)) {
+-      fprintf(stderr,"failed to read line %d\n", i);
++      fprintf(stdout,"failed to read line %d\n", i);
+     }
+   }
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/simage.git



More information about the debian-science-commits mailing list