<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='wrjpgcom1'>
<refmeta>
<refentrytitle>WRJPGCOM</refentrytitle>
<manvolnum>1E</manvolnum>
<refmiscinfo class='date'>15 June 1995</refmiscinfo>
<refmiscinfo class='source'>IJG</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>wrjpgcom</refname>
<refpurpose>insert text comments into a JPEG file</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>wrjpgcom</command>    
    <arg choice='opt'>-replace </arg>
    <arg choice='opt'>-comment <replaceable>text</replaceable></arg>
    <arg choice='opt'>-cfile <replaceable>name</replaceable></arg>
    <arg choice='opt'><replaceable>filename</replaceable></arg>
    <sbr/>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><command>wrjpgcom</command>
reads the named JPEG/JFIF file, or the standard input if no file is named,
and generates a new JPEG/JFIF file on standard output.  A comment block is
added to the file.</para>

<para>The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
Although the standard doesn't actually define what COM blocks are for, they
are widely used to hold user-supplied text strings.  This lets you add
annotations, titles, index terms, etc to your JPEG files, and later retrieve
them as text.  COM blocks do not interfere with the image stored in the JPEG
file.  The maximum size of a COM block is 64K, but you can have as many of
them as you like in one JPEG file.</para>

<para><command>wrjpgcom</command>
adds a COM block, containing text you provide, to a JPEG file.
Ordinarily, the COM block is added after any existing COM blocks; but you
can delete the old COM blocks if you wish.</para>
</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<para>Switch names may be abbreviated, and are not case sensitive.</para>
<variablelist remap='TP'>
  <varlistentry>
  <term><option>-replace</option></term>
  <listitem>
<para>Delete any existing COM blocks from the file.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-comment</option><replaceable> text</replaceable></term>
  <listitem>
<para>Supply text for new COM block on command line.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-cfile</option><replaceable> name</replaceable></term>
  <listitem>
<para>Read text for new COM block from named file.</para>
  </listitem>
  </varlistentry>
</variablelist>

<para>If you have only one line of comment text to add, you can provide it on the
command line with
<option>-comment</option>.
The comment text must be surrounded with quotes so that it is treated as a
single argument.  Longer comments can be read from a text file.</para>

<para>If you give neither
<option>-comment</option>
nor
<option>-cfile</option>,
then
<command>wrjpgcom</command>
will read the comment text from standard input.  (In this case an input image
file name MUST be supplied, so that the source JPEG file comes from somewhere
else.)  You can enter multiple lines, up to 64KB worth.  Type an end-of-file
indicator (usually control-D) to terminate the comment text entry.</para>

<para><command>wrjpgcom</command>
will not add a COM block if the provided comment string is empty.  Therefore
<option>-replace -comment ""</option> can be used to delete all COM blocks from a file.</para>
</refsect1>

<refsect1 id='examples'><title>EXAMPLES</title>
<para>Add a short comment to in.jpg, producing out.jpg:</para>

<para><userinput>wrjpgcom -c</userinput>
<emphasis remap='I'>"View of my back yard" in.jpg
</emphasis><emphasis remap='B'>&gt;</emphasis>
<emphasis remap='I'>out.jpg</emphasis></para>

<para>Attach a long comment previously stored in comment.txt:</para>

<para><command>wrjpgcom</command>
<emphasis remap='I'>in.jpg</emphasis>
<emphasis remap='B'>&lt;</emphasis>
<emphasis remap='I'>comment.txt</emphasis>
<emphasis remap='B'>&gt;</emphasis>
<emphasis remap='I'>out.jpg</emphasis></para>

<para>or equivalently</para>

<para><command>wrjpgcom</command>
<option>-cfile</option>
<replaceable>comment.txt</replaceable>
<emphasis remap='B'>&lt;</emphasis>
<emphasis remap='I'>in.jpg</emphasis>
<emphasis remap='B'>&gt;</emphasis>
<emphasis remap='I'>out.jpg</emphasis></para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>cjpeg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>djpeg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>jpegtran</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>rdjpgcom</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>Independent JPEG Group</para>
</refsect1>
</refentry>

