The Independent JPEG Group's JPEG software v6b

This commit is contained in:
Thomas G. Lane
1998-03-27 00:00:00 +00:00
committed by DRC
parent 489583f516
commit 5ead57a34a
89 changed files with 13297 additions and 2475 deletions

View File

@@ -1,7 +1,7 @@
/*
* wrjpgcom.c
*
* Copyright (C) 1994-1995, Thomas G. Lane.
* Copyright (C) 1994-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -38,9 +38,14 @@ extern void * malloc ();
#define READ_BINARY "r"
#define WRITE_BINARY "w"
#else
#ifdef VMS /* VMS is very nonstandard */
#define READ_BINARY "rb", "ctx=stm"
#define WRITE_BINARY "wb", "ctx=stm"
#else /* standard ANSI-compliant case */
#define READ_BINARY "rb"
#define WRITE_BINARY "wb"
#endif
#endif
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
#define EXIT_FAILURE 1
@@ -58,7 +63,7 @@ extern void * malloc ();
*/
#ifndef MAX_COM_LENGTH
#define MAX_COM_LENGTH 65000 /* must be < 65534 in any case */
#define MAX_COM_LENGTH 65000L /* must be <= 65533 in any case */
#endif
@@ -294,6 +299,9 @@ scan_JPEG_header (int keep_COM)
for (;;) {
marker = next_marker();
switch (marker) {
/* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,
* treated as SOFn. C4 in particular is actually DHT.
*/
case M_SOF0: /* Baseline */
case M_SOF1: /* Extended sequential, Huffman */
case M_SOF2: /* Progressive, Huffman */
@@ -447,7 +455,7 @@ main (int argc, char **argv)
ERREXIT("Insufficient memory");
strcpy(comment_arg, argv[argn]+1);
for (;;) {
comment_length = strlen(comment_arg);
comment_length = (unsigned int) strlen(comment_arg);
if (comment_length > 0 && comment_arg[comment_length-1] == '"') {
comment_arg[comment_length-1] = '\0'; /* zap terminating quote */
break;
@@ -458,7 +466,7 @@ main (int argc, char **argv)
strcat(comment_arg, argv[argn]);
}
}
comment_length = strlen(comment_arg);
comment_length = (unsigned int) strlen(comment_arg);
} else
usage();
}