[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    fbsplash
From:       Vladimir Dronnikov <dronnikov () gmail ! com>
Date:       2009-10-30 14:51:32
Message-ID: 6784529b0910300751wfff96bbw1db725e35c8bf820 () mail ! gmail ! com
[Download RAW message or body]

Hi, Michele!

Since .ppm files are rather big, a zipped ones would be nice to have.
Attached is the patch for fbsplash to cope with compressed image files
via standard  open_zipped() procedure.

Of course we could pipe image, say: "gunzip fbsplash -s -", but this
reserves stdin for image, and we have to workaround with mkfifo and
backgrounding (which is ugly).

With the patch, the following clean scenario is ok:

for i in 10 20 30 40 50 60 70 80 90 100 exit; do
   sleep 1 # or do something useful :)
   echo $p
done | fbsplash -cs image.ppm.gz -i cfgfile -f -

Please, review.

Regards,
--
Vladimir

["fbsplash.patch" (application/octet-stream)]

--- busybox.orig/miscutils/fbsplash.c	Thu Oct  8 19:18:26 2009
+++ busybox/miscutils/fbsplash.c	Fri Oct 30 02:49:48 2009
@@ -221,7 +221,14 @@
 	unsigned char *pixline;
 	unsigned i, j, width, height, line_size;
 
-	theme_file = xfopen_stdin(G.image_filename);
+	if (LONE_DASH(G.image_filename))
+		theme_file = stdin;
+	else {
+		int fd = open_zipped(G.image_filename);
+		if (fd < 0)
+			bb_simple_perror_msg_and_die(G.image_filename);
+		theme_file = fdopen(fd, "r");
+	}
 	head = xmalloc(256);
 
 	/* parse ppm header


_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic