ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/CV.xs
(Generate patch)

Comparing CV/CV.xs (file contents):
Revision 1.60 by root, Thu Jul 15 00:41:44 2021 UTC vs.
Revision 1.62 by root, Sun Jul 25 11:32:46 2021 UTC

451 && data[ 6] == 0x1a 451 && data[ 6] == 0x1a
452 && data[ 7] == 0x0a) 452 && data[ 7] == 0x0a)
453 RETVAL = "image/png"; 453 RETVAL = "image/png";
454 else if (data_len >= sizeof (jxl_header) && memcmp (data, jxl_header, sizeof (jxl_header)) == 0) 454 else if (data_len >= sizeof (jxl_header) && memcmp (data, jxl_header, sizeof (jxl_header)) == 0)
455 RETVAL = "image/jxl"; 455 RETVAL = "image/jxl";
456 else if (data_len >= 13
457 && data[0] == 'G'
458 && data[1] == 'I'
459 && data[2] == 'F'
460 && data[3] == '8'
461 //&& (data[4] == '7' || data[4] == '9')
462 && data[5] == 'a')
463 {
464 RETVAL = "image/gif";
465
466 // now see if its animated - we require the netscape application header for this
467 int ofs = 13;
468
469 if (data[10] & 0x80)
470 ofs += (1 << ((data[10] & 7) + 1)) * 3;
471
472 if (data_len >= ofs + 2 + 1 + 11)
473 {
474
475 // skip a graphic control extension block. we assume
476 // there is at most one such block - while the NAB
477 // has to come firstz, some files do not obey this
478 if (data[ofs] == 0x21 && data[ofs + 1] == 0xf9)
479 ofs += 3 + data[ofs + 2] + 1;
480
481 if (data_len >= ofs + 2 + 1 + 11)
482 if (!memcmp (data + ofs, "\x21\xff\x0bNETSCAPE2.0", sizeof ("\x21\xff\x0bNETSCAPE2.0") - 1))
483 RETVAL = "video/gif";
484 }
485 }
486
456 else 487 else
457 XSRETURN_UNDEF; 488 XSRETURN_UNDEF;
458} 489}
459 OUTPUT: 490 OUTPUT:
460 RETVAL 491 RETVAL

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines