Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shared-mime-info
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xdg
shared-mime-info
Commits
84dcf62c
Commit
84dcf62c
authored
Oct 15, 2020
by
Bastien Nocera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Kaitai Struct mime-type
parent
6f4947b0
Pipeline
#214119
passed with stage
in 1 minute and 20 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
0 deletions
+83
-0
data/freedesktop.org.xml.in
data/freedesktop.org.xml.in
+4
-0
tests/mime-detection/ico.ksy
tests/mime-detection/ico.ksy
+78
-0
tests/mime-detection/list
tests/mime-detection/list
+1
-0
No files found.
data/freedesktop.org.xml.in
View file @
84dcf62c
...
...
@@ -1903,6 +1903,10 @@ command to generate the output files.
</magic>
<glob
pattern=
"*.ui"
/>
</mime-type>
<mime-type
type=
"text/x-kaitai-struct"
>
<comment>
Kaitai Struct definition file
</comment>
<glob
pattern=
"*.ksy"
/>
</mime-type>
<mime-type
type=
"text/x-qml"
>
<comment>
Qt Markup Language file
</comment>
<magic
priority=
"80"
>
...
...
tests/mime-detection/ico.ksy
0 → 100644
View file @
84dcf62c
meta:
id: ico
title: Microsoft Windows icon file
file-extension: ico
endian: le
license: CC0-1.0
doc: |
Microsoft Windows uses specific file format to store applications
icons - ICO. This is a container that contains one or more image
files (effectively, DIB parts of BMP files or full PNG files are
contained inside).
doc-ref: https://msdn.microsoft.com/en-us/library/ms997538.aspx
seq:
- id: magic
contents: [0, 0, 1, 0]
- id: num_images
-orig-id: idCount
type: u2
doc: Number of images contained in this file
- id: images
-orig-id: idEntries
type: icon_dir_entry
repeat: expr
repeat-expr: num_images
types:
icon_dir_entry:
-orig-id: ICONDIRENTRY
seq:
- id: width
-orig-id: bWidth
type: u1
doc: Width of image, px
- id: height
-orig-id: bHeight
type: u1
doc: Height of image, px
- id: num_colors
-orig-id: bColorCount
type: u1
doc: |
Number of colors in palette of the image or 0 if image has
no palette (i.e. RGB, RGBA, etc)
- id: reserved
-orig-id: bReserved
contents: [0]
- id: num_planes
-orig-id: wPlanes
type: u2
doc: Number of color planes
- id: bpp
-orig-id: wBitCount
type: u2
doc: Bits per pixel in the image
- id: len_img
-orig-id: dwBytesInRes
type: u4
doc: Size of the image data
- id: ofs_img
-orig-id: dwImageOffset
type: u4
doc: Absolute offset of the image data start in the file
instances:
img:
pos: ofs_img
size: len_img
doc: |
Raw image data. Use `is_png` to determine whether this is an
embedded PNG file (true) or a DIB bitmap (false) and call a
relevant parser, if needed to parse image data further.
png_header:
pos: ofs_img
size: 8
doc: |
Pre-reads first 8 bytes of the image to determine if it's an
embedded PNG file.
is_png:
value: png_header == [137, 80, 78, 71, 13, 10, 26, 10]
doc: True if this image is in PNG format.
tests/mime-detection/list
View file @
84dcf62c
...
...
@@ -262,6 +262,7 @@ helloworld.java text/x-java ox
helloworld.groovy text/x-groovy ox
helloworld.vbs text/vbscript ox
build.gradle text/x-gradle ox
ico.ksy text/x-kaitai-struct ox
# Copied from http://asurvey.net/ccsfagent/media/survey.js
survey.js application/javascript ox
# Copied from gecko/accessible/src/jsat/Utils.jsm in Boot2Gecko
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment