Back to index

plt-scheme  4.2.1
Defines | Functions
transupp.c File Reference
#include "jinclude.h"
#include "jpeglib.h"
#include "transupp.h"

Go to the source code of this file.

Defines

#define JPEG_INTERNALS

Functions

 jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
 jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, JCOPY_OPTION option)

Define Documentation

#define JPEG_INTERNALS

Definition at line 18 of file transupp.c.


Function Documentation

jcopy_markers_execute ( j_decompress_ptr  srcinfo,
j_compress_ptr  dstinfo,
JCOPY_OPTION  option 
)

Definition at line 886 of file transupp.c.

{
  jpeg_saved_marker_ptr marker;

  /* In the current implementation, we don't actually need to examine the
   * option flag here; we just copy everything that got saved.
   * But to avoid confusion, we do not output JFIF and Adobe APP14 markers
   * if the encoder library already wrote one.
   */
  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {
    if (dstinfo->write_JFIF_header &&
       marker->marker == JPEG_APP0 &&
       marker->data_length >= 5 &&
       GETJOCTET(marker->data[0]) == 0x4A &&
       GETJOCTET(marker->data[1]) == 0x46 &&
       GETJOCTET(marker->data[2]) == 0x49 &&
       GETJOCTET(marker->data[3]) == 0x46 &&
       GETJOCTET(marker->data[4]) == 0)
      continue;                    /* reject duplicate JFIF */
    if (dstinfo->write_Adobe_marker &&
       marker->marker == JPEG_APP0+14 &&
       marker->data_length >= 5 &&
       GETJOCTET(marker->data[0]) == 0x41 &&
       GETJOCTET(marker->data[1]) == 0x64 &&
       GETJOCTET(marker->data[2]) == 0x6F &&
       GETJOCTET(marker->data[3]) == 0x62 &&
       GETJOCTET(marker->data[4]) == 0x65)
      continue;                    /* reject duplicate Adobe */
#ifdef NEED_FAR_POINTERS
    /* We could use jpeg_write_marker if the data weren't FAR... */
    {
      unsigned int i;
      jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);
      for (i = 0; i < marker->data_length; i++)
       jpeg_write_m_byte(dstinfo, marker->data[i]);
    }
#else
    jpeg_write_marker(dstinfo, marker->marker,
                    marker->data, marker->data_length);
#endif
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 861 of file transupp.c.

{
#ifdef SAVE_MARKERS_SUPPORTED
  int m;

  /* Save comments except under NONE option */
  if (option != JCOPYOPT_NONE) {
    jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);
  }
  /* Save all types of APPn markers iff ALL option */
  if (option == JCOPYOPT_ALL) {
    for (m = 0; m < 16; m++)
      jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
  }
#endif /* SAVE_MARKERS_SUPPORTED */
}

Here is the call graph for this function:

Here is the caller graph for this function: