<div dir="ltr">I'll add my 2¢ here, since I have some interest in both the file command, and this format.<br><br>I've attached my revised version of your pattern, which has some fixes and suggested changes.<br><br>It reduces false positives, fixes the "ext" clerical error, fixes an error in the regex (the string undergoes one round of backslash-unescaping before it gets to the regex engine, so you generally have to escape backslashes), makes the output well-formed even if the input file isn't, changes some signed ints to unsigned, changes some of the formatting and coding style to be more conventional.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Nov 12, 2025 at 2:15 AM Robert Jäschke <<a href="mailto:robert.jaeschke@hu-berlin.de">robert.jaeschke@hu-berlin.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<br>
<br>
are obsolete bitmap graphics formats still relevant for file? I've been<br>
researching the "CIS/COD" ("Lightning Strike") image file format¹ for a<br>
while now² and have created the magic description below.³ I would be<br>
pleased to see it included in file but you've got to decide how relevant<br>
this is.<br>
<br>
<br>
Best regards,<br>
Robert<br>
<br>
<br>
¹ <a href="http://justsolve.archiveteam.org/wiki/Lightning_Strike" rel="noreferrer" target="_blank">http://justsolve.archiveteam.org/wiki/Lightning_Strike</a><br>
² <a href="https://cod.igada.de/" rel="noreferrer" target="_blank">https://cod.igada.de/</a><br>
³ also available here: <a href="https://cod.igada.de/resources.html" rel="noreferrer" target="_blank">https://cod.igada.de/resources.html</a><br>
<br>
<br>
<br>
# Type: CIS/COD Bitmaps<br>
# Documentation: <a href="https://cod.igada.de/" rel="noreferrer" target="_blank">https://cod.igada.de/</a> and <a href="http://justsolve.archiveteam.org/wiki/Lightning_Strike" rel="noreferrer" target="_blank">http://justsolve.archiveteam.org/wiki/Lightning_Strike</a><br>
# From: Robert Jäschke <<a href="mailto:robert.jaeschke@hu-berlin.de" target="_blank">robert.jaeschke@hu-berlin.de</a>><br>
0       string    CIS       CIS/COD image data,<br>
!:mime  image/cis-cod<br>
!:ext   png<br>
# versions 2.3 to 2.5 are different to version 3.0<br>
>3      regex/4   2\.[345]  version %s,<br>
>>16    leshort   x         %d x<br>
>>18    leshort   x         %d<br>
# so far we know more about version 3.0<br>
>3      string/3  3.0       version %s,<br>
# width and height<br>
>>16    leshort   x         %d x<br>
>>18    leshort   x         %d x<br>
>>20    byte      x         %d<br>
# gray vs. color<br>
>>21    byte      0         (gray,<br>
>>21    byte      1         (color,<br>
# encoder type<br>
>>24    byte      1         lossy arithmetic encoder,<br>
>>24    byte      2         lossless arithmetic encoder,<br>
# compression type<br>
>>25    byte      1         bi-wavelet compression,<br>
# quantizer type<br>
>>26    byte      1         table quantization,<br>
# scb<br>
>>27    byte      1         SISD,<br>
# color space<br>
>>28    byte      1         YIQ RGB,<br>
>>28    byte      2         YUV RGB,<br>
>>28    byte      3         YCbCr RGB,<br>
# wavelet levels<br>
>>29    byte      x         %d wavelet levels)<br>
<br>
-- <br>
File mailing list<br>
<a href="mailto:File@astron.com" target="_blank">File@astron.com</a><br>
<a href="https://mailman.astron.com/mailman/listinfo/file" rel="noreferrer" target="_blank">https://mailman.astron.com/mailman/listinfo/file</a><br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Jason Summers<div><br></div></div></div>