I am dealing with exotic imagery file format (RAW of various kind).
so, i have my
<input type="file" accept="image/*">
which work for mostly all format, but for some reason, NEF is not "accepted".
so I have to manually add it after image/*, which looks wrong.
<input ... accept="image/*, .nef"/>
this is not supported on firefox-linux , nor on opera or chrome-MAC. so i expect it's neither browser or OS dependant
I have read various documentation on the subject, i am not photographer myself, but considering it work with others format.
do you know why the nef format is not supported ?
more important : do you know if others format than NEF is not supported ?
The input element considers the image/*
to handle image types. Webkit delegates the filter to the OS. For iOS, for instance, image/*
instructs the dialog to select files belonging to the UTTypeImage
type.
if ([mimeType caseInsensitiveCompare:@"image/*"] == NSOrderedSame)
[mediaTypes addObject:UTTypeImage.identifier];
This type is equivalent to the public.image
identifier you can see on System-Declared Uniform Type Identifiers.
NEF files belong to the UTI com.nikon.raw-image
which belongs to public.camera-raw-image
which belongs to public.image
.
The problem seems to come from the fact that
this is transmitted to UIDocumentPickerViewController@initWithDocumentTypes()
which only takes considers UTI declared with UTExportedTypeDeclarations
.
You can view which type are Imported or Exported using the command
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump
Here's the result for NEF
uti: com.nikon.raw-image
description: Nikon raw image
flags: imported active core apple-internal
icon:
conforms to: public.camera-raw-image
tags: .nef
This leaves us with the following list of images accepted by default when using image/*
: