[File] magic file for CIS/COD images ("Lightning Strike")

Jason Summers jason1 at pobox.com
Thu Nov 20 16:39:13 UTC 2025


I'll add my 2¢ here, since I have some interest in both the file command,
and this format.

I've attached my revised version of your pattern, which has some fixes and
suggested changes.

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.

On Wed, Nov 12, 2025 at 2:15 AM Robert Jäschke <robert.jaeschke at hu-berlin.de>
wrote:

> Dear all,
>
> are obsolete bitmap graphics formats still relevant for file? I've been
> researching the "CIS/COD" ("Lightning Strike") image file format¹ for a
> while now² and have created the magic description below.³ I would be
> pleased to see it included in file but you've got to decide how relevant
> this is.
>
>
> Best regards,
> Robert
>
>
> ¹ http://justsolve.archiveteam.org/wiki/Lightning_Strike
> ² https://cod.igada.de/
> ³ also available here: https://cod.igada.de/resources.html
>
>
>
> # Type: CIS/COD Bitmaps
> # Documentation: https://cod.igada.de/ and
> http://justsolve.archiveteam.org/wiki/Lightning_Strike
> # From: Robert Jäschke <robert.jaeschke at hu-berlin.de>
> 0       string    CIS       CIS/COD image data,
> !:mime  image/cis-cod
> !:ext   png
> # versions 2.3 to 2.5 are different to version 3.0
> >3      regex/4   2\.[345]  version %s,
> >>16    leshort   x         %d x
> >>18    leshort   x         %d
> # so far we know more about version 3.0
> >3      string/3  3.0       version %s,
> # width and height
> >>16    leshort   x         %d x
> >>18    leshort   x         %d x
> >>20    byte      x         %d
> # gray vs. color
> >>21    byte      0         (gray,
> >>21    byte      1         (color,
> # encoder type
> >>24    byte      1         lossy arithmetic encoder,
> >>24    byte      2         lossless arithmetic encoder,
> # compression type
> >>25    byte      1         bi-wavelet compression,
> # quantizer type
> >>26    byte      1         table quantization,
> # scb
> >>27    byte      1         SISD,
> # color space
> >>28    byte      1         YIQ RGB,
> >>28    byte      2         YUV RGB,
> >>28    byte      3         YCbCr RGB,
> # wavelet levels
> >>29    byte      x         %d wavelet levels)
>
> --
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
>


-- 
Jason Summers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20251120/4480b40a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cis-cod.magic
Type: application/octet-stream
Size: 1422 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20251120/4480b40a/attachment.obj>


More information about the File mailing list