Discussion:
some issues with mime types
kendell clark
2018-06-09 19:01:59 UTC
Permalink
hi

OK, I feel stupid. Apparently linux doesn't identify everything with a
.bin extension as sega disk image, it also detects sega saturn rom
images. However, it does still identify everything else with a .bin
extension as sega cd disk images, even windows software. I'm not sure
what can be done about this, it seems impossible to automagically detect
everything possiblt that uses a .bin extension. Maybe increase the magic
priority on sega rom types?

Thanks

Kendell Clark
    hi
I have filed a new bug against shared mime info at,
https://bugs.freedesktop.org/show_bug.cgi?id=106792. I accidentally
commented on a bug that was not mine, I've attempted to find a way to
delete the comment since it was clearly the wrong bug but I can't find a
remove comment button. This is a feature request, not a problem or bug
in shared mime info itself, but I couldn't find a feature request
option.   
Thanks
Kendell Clark
hi all
I play a lot of emulated game consoles, from regular nintendo, nes to
playstation 2, ps2. The freedesktop mime database has no magic detection
for nes, snes, wanderswan, some of the older atari rom types, and
doesn't support ps1 or 2 rom images, nor xbox images. I'd like to help
improve this. I have a couple of ps1 and one ps2 roms I can provide, so
a magic sequence can be found, because of now caja identifies everything
with a .bin extension as a "sega cd disk image" when they clearly
aren't. This doesn't affect playability, I just use mednafen or pcsx2 to
open the files but it is a little bit confusing. Also, does anyone have
any desire to improve the set of generic icons for game image files? I
know that game titles are probably copyright in terms of logos and such,
but is it possible to provide a blank NES cartridge, or a blank Snes
cartridge, blank sega cartridge, etc to use as icons instead of the
generic executible icon? Same for gamecube, wii and playstationa nd xbox
rom images, if those get added? I have blank dvd's, I'd be happy to take
pictures of them and remove any branding, and I also have a couple of
gamecube mini disks, I could do the same thing. I'd also be interested
in helping improve the existing mime database.
Thanks
Kendell Clark
--
Open source is much more than just a license. It is a community of like minded users and developers committed to exercising their rights to use, study, improve, and discuss software and ideas. And breaking drm wherever they find it.
Thomas Kluyver
2018-06-10 15:09:49 UTC
Permalink
Post by kendell clark
OK, I feel stupid. Apparently linux doesn't identify everything with a
.bin extension as sega disk image, it also detects sega saturn rom
images. However, it does still identify everything else with a .bin
extension as sega cd disk images, even windows software. I'm not sure
what can be done about this, it seems impossible to automagically detect
everything possiblt that uses a .bin extension. Maybe increase the magic
priority on sega rom types?
Looking at the shared-mime-info xml file on my computer, there are three mime types with a '*.bin' glob pattern:

- application/x-sega-cd-rom (with magic string SEGADISCSYSTEM)
- application/x-saturn-rom (with magic string SEGA SEGASATURN)
- application/octet-stream (no magic)

The last is the generic 'unknown binary' type, so is what it should be using for .bin files unless they're one of the more specific types.

If the tool you're using looks at the file contents to check magic strings, I think it's a bug in that tool if it identifies arbitrary .bin files as Sega CD images. Those files should fail the magic checks for both SEGA file types and fall back to the generic one.

Unfortunately, if it's just going by filename, there's no way for it to reliably get the right type. Making the octet-stream glob higher priority would make it find that. But in that case, tools that follow the recommended steps would never detect the Sega formats, even if they were prepared to do magic sniffing, because if one glob match has higher priority, the recommended steps skip magic sniffing.
https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html#idm140625828606432

Thomas

Continue reading on narkive:
Loading...