Only in JPEGv1.2.1_PatchedForMacOSXOffsetType: blkint.jpg.1 Only in JPEGv1.2.1_PatchedForMacOSXOffsetType: blkint.jpg.2 Only in JPEGv1.2.1_PatchedForMacOSXOffsetType: blkint.jpg.3 diff -c -r JPEGv1.2.1/io.c JPEGv1.2.1_PatchedForMacOSXOffsetType/io.c *** JPEGv1.2.1/io.c Wed Mar 1 20:57:22 1995 --- JPEGv1.2.1_PatchedForMacOSXOffsetType/io.c Fri Feb 21 10:58:42 2003 *************** *** 36,41 **** --- 36,42 ---- #include #include #endif + #include /* Functions which are local and which are exported. */ *************** *** 439,445 **** BUFFER *buffer; { BEGIN("ReadResizeBuffer"); ! int retval,diff,location,amount; diff = buffer->tptr - buffer->bptr; /* Find out the current usage */ if (len > buffer->size-1) /* calculate if we can hold it */ --- 440,447 ---- BUFFER *buffer; { BEGIN("ReadResizeBuffer"); ! int retval,diff,amount; ! off_t location; diff = buffer->tptr - buffer->bptr; /* Find out the current usage */ if (len > buffer->size-1) /* calculate if we can hold it */ *************** *** 490,500 **** { BEGIN("FlushBuffer"); int retval; #ifdef IO_DEBUG printf("WriteLseek %d\n",buffer->streamoffs+buffer->currentoffs); #endif ! lseek(buffer->iob->file,buffer->streamoffs+buffer->currentoffs,L_SET); if ((retval = write(buffer->iob->file, buffer->space, (buffer->bptr - buffer->space))) < 0) --- 492,504 ---- { BEGIN("FlushBuffer"); int retval; + off_t location; #ifdef IO_DEBUG printf("WriteLseek %d\n",buffer->streamoffs+buffer->currentoffs); #endif ! location=buffer->streamoffs+buffer->currentoffs; ! lseek(buffer->iob->file,location,L_SET); if ((retval = write(buffer->iob->file, buffer->space, (buffer->bptr - buffer->space))) < 0) *************** *** 747,766 **** void SeekEndIob() { BEGIN("SeekEndIob"); ! int size,tsize; static char Terminator[] = {0x80,0x00}; ! size = lseek(Iob->file,0,2); tsize = Iob->width*Iob->height*Iob->wsize; if (size != tsize) { WHEREAMI(); printf("End not flush, making flush (actual: %d != target:%d)\n", ! size,tsize); if (sizefile,tsize-1,0L); /* Seek and terminate */ write(Iob->file,Terminator,1); } else if (size > tsize) --- 751,775 ---- void SeekEndIob() { BEGIN("SeekEndIob"); ! off_t size,tsize; static char Terminator[] = {0x80,0x00}; + off_t location; + struct stat sb; ! location=0; ! /*size = lseek(Iob->file,location,2);*/ ! fstat(Iob->file,&sb); ! size=sb.st_size; tsize = Iob->width*Iob->height*Iob->wsize; if (size != tsize) { WHEREAMI(); printf("End not flush, making flush (actual: %d != target:%d)\n", ! (int)size,(int)tsize); if (sizefile,tsize-1,0); /* Seek and terminate */ write(Iob->file,Terminator,1); } else if (size > tsize) *************** *** 768,774 **** #ifdef NOTRUNCATE WHEREAMI(); printf("file is too large, only first %d bytes valid\n", ! tsize); #else ftruncate(Iob->file,tsize); /* simply truncate*/ #endif --- 777,783 ---- #ifdef NOTRUNCATE WHEREAMI(); printf("file is too large, only first %d bytes valid\n", ! (int)tsize); #else ftruncate(Iob->file,tsize); /* simply truncate*/ #endif *************** *** 885,891 **** void TerminateFile() { BEGIN("TerminateFile"); ! int i,size; static char Terminator[] = {0x80,0x00}; if (CFrame->GlobalHeight) --- 894,902 ---- void TerminateFile() { BEGIN("TerminateFile"); ! int i; ! off_t size; ! off_t location; static char Terminator[] = {0x80,0x00}; if (CFrame->GlobalHeight) *************** *** 907,922 **** CFrame->vf[CScan->ci[i]]); InstallIob(i); FlushIob(); ! size = lseek(CScan->Iob[i]->file,0,2); ! if (size != ! CFrame->Width[CScan->ci[i]]*CFrame->Height[CScan->ci[i]]* ! CScan->Iob[i]->wsize) { /* Terminate file */ ! lseek(CScan->Iob[i]->file, /* by seeking to end */ ! (CFrame->Width[CScan->ci[i]]* /* And writing byte */ ! CFrame->Height[CScan->ci[i]]* ! CScan->Iob[i]->wsize)-1, /* Making flush with */ ! 0L); /* Original size */ write(CScan->Iob[i]->file,Terminator,1); } } --- 918,931 ---- CFrame->vf[CScan->ci[i]]); InstallIob(i); FlushIob(); ! location=0; ! size = lseek(CScan->Iob[i]->file,location,2); ! location=CFrame->Width[CScan->ci[i]]*CFrame->Height[CScan->ci[i]]*CScan->Iob[i]->wsize; ! if (size != location) { /* Terminate file */ ! lseek(CScan->Iob[i]->file, /* by seeking to end and writing byte */ ! location-1, /* Making flush with */ ! 0); /* Original size */ write(CScan->Iob[i]->file,Terminator,1); } } diff -c -r JPEGv1.2.1/makefile JPEGv1.2.1_PatchedForMacOSXOffsetType/makefile *** JPEGv1.2.1/makefile Wed Mar 1 20:57:26 1995 --- JPEGv1.2.1_PatchedForMacOSXOffsetType/makefile Fri Feb 21 10:42:11 2003 *************** *** 54,60 **** # Caution: Sometimes -ll is required. # # ! #lexer.c: lexer.l ! # lex lexer.l ! # mv lex.yy.c lexer.c # --- 54,60 ---- # Caution: Sometimes -ll is required. # # ! lexer.c: lexer.l ! lex -ll lexer.l ! mv lex.yy.c lexer.c #