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.61 by root, Sun Jul 25 11:24:48 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 // skip a rare first graphic control extension block
475 // we assume there is exactly one block
476 if (data[ofs] == 0x21 && data[ofs + 1] == 0xf9)
477 ofs += 3 + data[ofs + 2] + 1;
478
479 if (data_len >= ofs + 2 + 1 + 11)
480 if (!memcmp (data + ofs, "\x21\xff\x0bNETSCAPE2.0", sizeof ("\x21\xff\x0bNETSCAPE2.0") - 1))
481 RETVAL = "video/gif";
482 }
483 }
484
456 else 485 else
457 XSRETURN_UNDEF; 486 XSRETURN_UNDEF;
458} 487}
459 OUTPUT: 488 OUTPUT:
460 RETVAL 489 RETVAL

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines