So, the default behaviour is the same as specifying "cat >
%s.png" as FILTER.
+ If FILTER is just "-", the PNG image is written to stdout.
+
<li> -a
Enable anti-alias drawing.
¤Î¥Ù¡¼¥¹¥Í¡¼¥à¤ËÃÖ¤´¹¤¨¤é¤ì¤ë¡£¤³¤Î¥×¥í¥°¥é¥à¤Î¥Ç¥Õ¥©¥ë¥È¤Î¿¶Éñ¤¤
¤È¡¢FILTER ¤Ë "cat > %s.png" ¤ò»ØÄꤷ¤¿¾ì¹ç¤Î¿¶Éñ¤ÏƱ°ì¤Ç¤¢¤ë¡£
+ ¤â¤· FILTER ¤¬Ã±¤Ë "-" ¤Ç¤¢¤ì¤Ð¡¢ PNG ²èÁü¤Ï stdout ¤Ë½ÐÎϤµ¤ì¤ë¡£
+
<li> -a
¥¢¥ó¥Á¥¨¥¤¥ê¥¢¥¹½èÍý¤ò¹Ô¤¦¡£
if (filter)
{
- char *command = alloca (strlen (filename) + strlen (filter) + 1);
+ if (filter[0] == '-' && filter[1] == '\0')
+ fp = stdout;
+ else
+ {
+ char *command = alloca (strlen (filename) + strlen (filter) + 1);
- sprintf (command, filter, filename);
- fp = popen (command, "w");
- if (! fp)
- FATAL_ERROR ("Can't run the command \"%s\"\n", command);
- if (! quiet_mode)
- printf ("Running \"%s\" ... ", command);
+ sprintf (command, filter, filename);
+ fp = popen (command, "w");
+ if (! fp)
+ FATAL_ERROR ("Can't run the command \"%s\"\n", command);
+ if (! quiet_mode)
+ printf ("Running \"%s\" ... ", command);
+ }
}
else
{
/* Generate PNG. */
gdImagePng (image, fp);
- fclose (fp);
+ if (fp != stderr)
+ fclose (fp);
if (! quiet_mode)
printf (" done (%dx%d)\n", image->sx, image->sy);
}