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 support and recognition for "X BitMap" images #4133

Merged
merged 5 commits into from
May 28, 2018
Merged

Add support and recognition for "X BitMap" images #4133

merged 5 commits into from
May 28, 2018

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented May 16, 2018

This PR introduces support for a text-based bitmap image format called X BitMap. (Not to be confused with the currently-supported and superficially similar format, X PixMap.

Description

This PR also adjusts XPM's languages.yml entry so it's technically correct and uses its longer, human-readable name (since that's how those images get referred to everywhere else).

Both formats use C syntax, so I've lumped them under the C group whilst leaving their language-types to data (since that's ultimately what they are).

In-the-wild usage

~364,280 results for xbm files, none of them shared with a recognised language. From what I've gone through, they're all XBM data.

Sample files

Update:
Replaced the sample images with a manually-converted one that's free from licensing complications.
Both of the xbm samples I've added were hocked from w3c/libwww:

Licensing-wise, they're released under the W3C Software Notice and License, which is new to me. Wikipedia's page for the W3C's license states that it's acceptably permissive and non-copyleft, though it mentions GPIL compatibility.

The full license text can be found here. Should we summon the wisdom of our venerable LawGuruGuy™, @mlinksva? Even though this license looks okay, I dare not tread the swampy waters of "Legal-Looking Stuff That Will Actually Get You Life-Jailed If You Read It Wrong". Hereafter known as LLSTWAGYLJIYRIW, my new favourite Perl motto.

XBM ("X BitMap") files are an early precursor to XPM ("X PixMap") files,
which are currently supported on GitHub (albeit with a misleading name).
@Alhadis Alhadis requested a review from mlinksva May 16, 2018 03:27
@pchaigno
Copy link
Contributor

Should we summon the wisdom of our venerable LawGuruGuy™, @mlinksva? Even though this license looks okay, I dare not tread the swampy waters of "Legal-Looking Stuff That Will Actually Get You Life-Jailed If You Read It Wrong". Hereafter known as LLSTWAGYLJIYRIW, my new favourite Perl motto.

Didn't we discuss copyleft licenses not being an issue for sample files not so long ago? (I can't find the issue/PR again :-/)

codemirror_mode: clike
codemirror_mime_type: text/x-csrc
language_id: 782911107
X PixMap:
Copy link
Member

Choose a reason for hiding this comment

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

Aaaah, man. This is a PITA for me. I need to relearn Rails migrations if we do this. If I don't put in a migration, we end up with the same problems we had with the Pelr6 -> Perl 6 change and the DB and search gods frown upon me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, erh, should we then start thoroughly reviewing the hell out of every single grammar-name to make any other potential future change happen in one migration? 😅

I didn't want to rename the entry, as I am conscious of how much of a pain it is database-wise. 😞 Unfortunately, I can't change fact. :( That's a fact.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If the KiCad incident last year proved anything, it's that inaccuracies in language.yml are better dealt with much sooner than a hell of a lot later. 😥

@mlinksva
Copy link
Contributor

W3C is fine. I don't see a copy of it in this PR though.

@Alhadis
Copy link
Collaborator Author

Alhadis commented May 16, 2018

Oh. No, I didn't include a copy as I was asking about licenses for sample files.

Didn't we discuss copyleft licenses not being an issue for sample files not so long ago? (I can't find the issue/PR again :-/)

So I'm guessing @pchaigno is right?

@mlinksva
Copy link
Contributor

@Alhadis if we're relying on a license to distribute sample material from this repo, we need to comply with the license we're relying on. The W3C license requires keeping a copy of the license. I recall this coming up before regarding samples: #3650 (comment)

Converted from a 32×32-sized icon of an SVG version of the Public Domain
symbol, which was sourced from Wikipedia.
@Alhadis
Copy link
Collaborator Author

Alhadis commented May 22, 2018

Actually, never mind. I converted one myself (using a 32×32-sized 2-colour version of the Public Domain symbol):

cc-public_domain_mark_white

Generated via ffmpeg:

λ ffmpeg -i .gif image.xbm
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, gif, from 'Cc-public_domain_mark_white.gif':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: gif, bgra, 32x32, 10 tbr, 100 tbn, 100 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (gif (native) -> xbm (native))
Press [q] to stop, [?] for help
[swscaler @ 0x7ff0df817400] full chroma interpolation for destination format 'monow' not yet implemented
Output #0, image2, to 'o.xbm':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Video: xbm, monow, 32x32, q=2-31, 200 kb/s, 10 fps, 10 tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.18.100 xbm
frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.10 bitrate=N/A speed=  67x    
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

@mlinksva
Copy link
Contributor

@Alhadis 🆒. Side note: slightly better, or additional, link in your comment above would be to https://commons.wikimedia.org/wiki/File:Cc-public_domain_mark_white.svg (the page about the file, which on Wikimedia Commons always includes copyright/license/public domain info). It isn't a given that an image about the public domain will itself be public domain 😬 though thankfully this one is.

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

Looks like we’ve got code in place to easily make the name changes within the database, so I’m happy to merge this now. 🙇‍♂️ @Alhadis

@Alhadis Alhadis merged commit 2356ae7 into master May 28, 2018
@Alhadis Alhadis deleted the xbm branch May 28, 2018 08:32
lildude added a commit that referenced this pull request May 30, 2018
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants