mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.0.9beta1.tar
This commit is contained in:
@@ -45,9 +45,9 @@ $ call make pnm2png.exe -
|
||||
$ write sys$output "Building png2pnm..."
|
||||
$ CALL MAKE png2pnm.OBJ "cc ''CCOPT' png2pnm" -
|
||||
png2pnm.c
|
||||
$ call make pnm2png.exe -
|
||||
"LINK pnm2png,lib.opt/opt" -
|
||||
pnm2png.obj
|
||||
$ call make png2pnm.exe -
|
||||
"LINK png2pnm,lib.opt/opt" -
|
||||
png2pnm.obj
|
||||
$ exit
|
||||
$!
|
||||
$!
|
||||
|
||||
@@ -204,6 +204,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
|
||||
int row, col;
|
||||
int ret;
|
||||
int i;
|
||||
long dep_16;
|
||||
|
||||
/* read and check signature in PNG file */
|
||||
ret = fread (buf, 1, 8, png_file);
|
||||
@@ -379,8 +380,10 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
|
||||
if (raw)
|
||||
fputc ((int) *pix_ptr++ , pnm_file);
|
||||
else
|
||||
if (bit_depth == 16)
|
||||
fprintf (pnm_file, "%ld ", ((long) *pix_ptr++ << 8) + (long) *pix_ptr++);
|
||||
if (bit_depth == 16){
|
||||
dep_16 = (long) *pix_ptr++;
|
||||
fprintf (pnm_file, "%ld ", (dep_16 << 8) + ((long) *pix_ptr++));
|
||||
}
|
||||
else
|
||||
fprintf (pnm_file, "%ld ", (long) *pix_ptr++);
|
||||
}
|
||||
@@ -397,8 +400,10 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
|
||||
if (raw)
|
||||
fputc ((int) *pix_ptr++ , alpha_file);
|
||||
else
|
||||
if (bit_depth == 16)
|
||||
fprintf (alpha_file, "%ld ", ((long) *pix_ptr++ << 8) + (long) *pix_ptr++);
|
||||
if (bit_depth == 16){
|
||||
dep_16 = (long) *pix_ptr++;
|
||||
fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++);
|
||||
}
|
||||
else
|
||||
fprintf (alpha_file, "%ld ", (long) *pix_ptr++);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user