Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jpe,jif,jfif as image/jpeg mime type #291

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/custom-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,11 @@
]
},
"image/jpeg": {
"compressible": false
"compressible": false,
"extensions": ["jif", "jfif"],
"sources": [
"https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types#jpeg_joint_photographic_experts_group_image"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the primary source to be linked fom where these are defined. The MDN site is a secondary source.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its frustrating because it's not mentioned on the IANA site, but it is an ISO standard.

This is from the official JPEG site https://jpeg.org/jpeg/workplan.html:

ITU-T T.871 (2011) — ISO/IEC 10918-5:2013:
JPEG File Interchange Format (JFIF)
(ITU page, ITU edition 1, ISO page, ISO edition 1, in stage 90.93)

Is the ISO page good enough?

There's also this via the JFIF Wikipedia page: https://www.w3.org/Graphics/JPEG/jfif3.pdf

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I wonder where did the MDN page get it then? Maybe I am confused, but your quotes does not say that JFIF is a file extension, just the abbreviation of JPEG File Interchange Format.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can contact one of these standards bodies for clarification.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It clearly is a file extension for jpeg files same as this Adobe page talks about it https://www.adobe.com/creativecloud/file-types/image/raster/jpeg-file.html - but it doesn't seem like it was standardised anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Unfortunately this just isn't the purpose of this module, to be a registry -- it is built to be a JSON version of the three sources listed at the top of the module's README. We can accept other ones that are not in there, but it needs to be very clear standard or like something is broken with our scraping of those three sources. I suggest the best way forward without some kind of confirmation from JPEG itself that someone get it registered in IANA. This module is slowing eliminating all entries not included in those three sources, and this seems contrary to the module's direction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally for file extensions, we are looking for a first-party source which clearly states that "file extension X represents mime type Y"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I would like to ideally see if we can get these added to one of our upstream sources or fine some page to link to. I actually emailed JPEG to ask them, since it wasn't clear if you did that or not already. I'll see what they say.

Copy link
Author

@ianchanning ianchanning May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see it there is no primary source for even 'jpg' being an official extension. IANA doesn't include it. You include it because Apache does and they also include 'jpe' - but with no reason given.

image/jpeg					jpeg jpg jpe

JPEG don't specify any file extensions, Windows just decided to use jpg to keep it short and everyone else jpeg.

So you don't think you can find a primary source for 'jpg'.

So I doubt we'll get much out of JPEG - I don't think they care about the extension.

Copy link
Author

@ianchanning ianchanning May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually now that I've seen that jpe is included in the Apache list I can remove it from this PR.

I'm happy if you want to close this - it makes sense to have a clear definition for what is or isn't included here.

]
},
"image/jpm": {
"compressible": false,
Expand Down