Skip to content

Commit

Permalink
Add GIF and JPEG (JFIF) specs (#1237)
Browse files Browse the repository at this point in the history
This adds the GIF and JPEG specifications to the list, as requested in #1089.

For GIF, the most canonical URL is the specification published under `w3.org`,
consistent with Specref and Wikipedia.

The notion of group does not mean much for the GIF spec. Also, the link to the
CompuServe website seems a bit wrong, but a URL is needed...

For JPEG, the usual reference is to the interchange format (JFIF). A PDF
version of the 1992 spec exists under `w3.org` at:
https://www.w3.org/Graphics/JPEG/jfif3.pdf

That is the spec that Specref returns for JPEG. That said, JPEG is published
and maintained by ISO/IEC under the name `iso10918-5`:
https://www.iso.org/standard/54989.html

That spec (and name) is used in the list instead of the PDF version because it
provides a more official entry point. If we want to record the public version
from 1992 somewhere, a new "JPEG" or "JPEG-1992" entry could perhaps be
created.

Schema and logic adjusted to allow ".txt" filenames (should not break anything)
for the GIF entry.
  • Loading branch information
tidoust authored Feb 28, 2024
1 parent 4196da5 commit 8fe9a2a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion schema/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

"filename": {
"type": "string",
"pattern": "^[\\w\\-\\.]+\\.(html|pdf)$"
"pattern": "^[\\w\\-\\.]+\\.(html|pdf|txt)$"
},

"relativePath": {
Expand Down
17 changes: 17 additions & 0 deletions specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@
"https://wicg.github.io/webpackage/loading.html",
"https://wicg.github.io/webusb/",
"https://wicg.github.io/window-controls-overlay/",
{
"url": "https://www.iso.org/standard/54989.html",
"shortname": "iso10918-5",
"shortTitle": "JPEG"
},
{
"url": "https://www.iso.org/standard/85253.html",
"shortname": "iso18181-2",
Expand Down Expand Up @@ -775,6 +780,18 @@
"repository": "https://github.com/w3c/w3process/"
}
},
{
"url": "https://www.w3.org/Graphics/GIF/spec-gif89a.txt",
"shortname": "GIF",
"shortTitle": "GIF",
"organization": "CompuServe Incorporated",
"groups": [
{
"name": "CompuServe Incorporated",
"url": "https://www.compuserve.com/"
}
]
},
"https://www.w3.org/TR/accelerometer/",
"https://www.w3.org/TR/accname-1.2/",
"https://www.w3.org/TR/ambient-light/",
Expand Down
2 changes: 1 addition & 1 deletion src/determine-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

module.exports = async function (url) {
// Extract filename directly from the URL when possible
const match = url.match(/\/([^/]+\.(html|pdf))$/);
const match = url.match(/\/([^/]+\.(html|pdf|txt))$/);
if (match) {
return match[1];
}
Expand Down

0 comments on commit 8fe9a2a

Please sign in to comment.