rdjpgcom
Read JPEG comments
SYNOPSIS
rdjpgcom [options] [filename ...]
PARAMETERS
-v
Enable verbose mode. Prints the filename before displaying comments for each processed file.
-s
Suppress warnings about non-standard JPEG markers encountered in the input file(s).
-t
Truncate the output comment at the first newline character, useful for extracting single-line comments.
DESCRIPTION
rdjpgcom is a utility included in the libjpeg project, designed to extract and display text comments embedded within JPEG image files. JPEG files can contain arbitrary text strings in special "comment" markers (JFIF COM markers). These comments are often used to store metadata, copyright notices, descriptions, or any other user-defined text information directly within the image file. The command reads the specified JPEG file(s) and prints all found comments to standard output. If no filename is provided, it reads from standard input, allowing it to be used in pipelines. It's a straightforward tool for quickly inspecting the textual metadata of JPEG images without needing to open them in an image editor.
CAVEATS
rdjpgcom specifically targets JFIF COM (comment) markers. It will not extract other types of metadata, such as EXIF data or XMP metadata. For those, other tools like exiftool or jpegtran (for EXIF only) would be necessary. Also, the command treats comments as plain text; it does not interpret or display them in any formatted way.
BASIC USAGE
To display comments from a single JPEG file:rdjpgcom image.jpg
To display comments from multiple JPEG files:rdjpgcom image1.jpg image2.jpg
READING FROM STANDARD INPUT
You can pipe image data to rdjpgcom. For example, to read comments from an image whose data is generated by another command:cat image.jpg | rdjpgcom
VERBOSE OUTPUT
To see the filename before its comments, especially useful when processing multiple files:rdjpgcom -v image.jpg another.jpeg
HISTORY
rdjpgcom is an integral part of the libjpeg project, which originated in the early 1990s as a free and open-source implementation of the JPEG standard. Its primary goal was to provide a widely available and efficient library for JPEG compression and decompression. As part of this suite, rdjpgcom and its counterpart wrjpgcom were developed to handle the simple text comment feature of the JPEG format, allowing users to embed or extract basic textual metadata directly within the image stream. Its usage remains consistent with the core philosophy of libjpeg: providing fundamental tools for JPEG file manipulation.


