mirror of
				https://git.code.sf.net/p/libpng/code.git
				synced 2025-07-10 18:04:09 +02:00 
			
		
		
		
	[libpng16] Write the profile MD5s from checksum-icc (and the date)
This commit is contained in:
		
							parent
							
								
									51d1e2be1b
								
							
						
					
					
						commit
						c1217ee280
					
				| @ -21,6 +21,7 @@ read_one_file(FILE *ip, const char *name) | |||||||
|    uLong length = 0; |    uLong length = 0; | ||||||
|    uLong a32 = adler32(0, NULL, 0); |    uLong a32 = adler32(0, NULL, 0); | ||||||
|    uLong c32 = crc32(0, NULL, 0); |    uLong c32 = crc32(0, NULL, 0); | ||||||
|  |    Byte header[132]; | ||||||
| 
 | 
 | ||||||
|    for (;;) |    for (;;) | ||||||
|    { |    { | ||||||
| @ -31,6 +32,9 @@ read_one_file(FILE *ip, const char *name) | |||||||
| 
 | 
 | ||||||
|       b = (Byte)ch; |       b = (Byte)ch; | ||||||
| 
 | 
 | ||||||
|  |       if (length < sizeof header) | ||||||
|  |          header[length] = b; | ||||||
|  | 
 | ||||||
|       ++length; |       ++length; | ||||||
|       a32 = adler32(a32, &b, 1); |       a32 = adler32(a32, &b, 1); | ||||||
|       c32 = crc32(c32, &b, 1); |       c32 = crc32(c32, &b, 1); | ||||||
| @ -40,8 +44,18 @@ read_one_file(FILE *ip, const char *name) | |||||||
|       return 0; |       return 0; | ||||||
| 
 | 
 | ||||||
|    /* Success */ |    /* Success */ | ||||||
|    printf("{ 0x%8.8lx, 0x%8.8lx, %lu, \"%s\" },\n", (unsigned long)a32, |    printf("{ 0x%8.8lx, 0x%8.8lx, " | ||||||
|       (unsigned long)c32, (unsigned long)length, name); |       "0x%2.2x%2.2x%2.2x%2.2x, 0x%2.2x%2.2x%2.2x%2.2x, " | ||||||
|  |       "0x%2.2x%2.2x%2.2x%2.2x, 0x%2.2x%2.2x%2.2x%2.2x,\n" | ||||||
|  |       "  \"%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d\", %lu, \"%s\" },\n", | ||||||
|  |       (unsigned long)a32, (unsigned long)c32, | ||||||
|  |       header[84], header[85], header[86], header[87], | ||||||
|  |       header[88], header[89], header[90], header[91], | ||||||
|  |       header[92], header[93], header[94], header[95], | ||||||
|  |       header[96], header[97], header[98], header[99], | ||||||
|  | #     define u16(x) (header[x] * 256 + header[x+1]) | ||||||
|  |       u16(24), u16(26), u16(28), u16(30), u16(32), u16(34), | ||||||
|  |       (unsigned long)length, name); | ||||||
| 
 | 
 | ||||||
|    return 1; |    return 1; | ||||||
| } | } | ||||||
| @ -50,7 +64,8 @@ int main(int argc, char **argv) | |||||||
| { | { | ||||||
|    int err = 0; |    int err = 0; | ||||||
| 
 | 
 | ||||||
|    printf("= { /* adler32   crc32   length  name */\n"); |    printf("= {\n/* adler32       crc32                        MD5\n" | ||||||
|  |          "           date         length       name */\n"); | ||||||
| 
 | 
 | ||||||
|    if (argc > 1) |    if (argc > 1) | ||||||
|    { |    { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 John Bowler
						John Bowler