2

I was planning to use html2canvas

The license is really confusing to me, as it's never stated which parts are for Microsoft, which are not and if the whole code is licensed under MIT, as it also states: Copyright (c) Microsoft Corporation. All rights reserved.

Here is a link to the file including the licenses.

And here is the license text for reference:

/*!
 * html2canvas 1.0.0-rc.5 <https://html2canvas.hertzen.com>
 * Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 */

/*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */

Is it okay to use this in a commercial project? (while preserving the exact same license text and not modifying the file, including it as is)

1

It looks like to me as if html2canvas contains code from Microsoft's TypeScript project. I don't know if the inclusion was manual or via an automatic tool, but it makes html2canvas a derivative of TypeScript, in copyright terms.

TypeScript is licensed under Apache2. This requires that any derivative work include the Apache licence text (s4a) and the original copyright notices (s4c), but it does not require that the derivative actually be distributed under the terms of Apache2. It is therefore lawful for html2canvas' author to have used the TypeScript code in this manner. If you wish to reuse any of the code, you may do under the terms of the MIT licence. If you would prefer to reuse just the TypeScript portion and to do so under Apache2, you can get it directly from Microsoft's github site under those terms.

Either of those licences will allow reuse in a commercial product (by which I presume you mean proprietary; note that even GPL code can be commercially distributed), subject to their notice-preservation and other applicable terms.

We have discussed the tendency to include the phrase all rights reserved at some length. The conclusion I favour is that it is a purely historical piece of cargo-cult labelling, and means nothing in the context of modern copyright. It's actively unhelpful when used in the context of freely-licensed code, as your question shows, and I wish people would stop doing it.

| improve this answer | |
  • Thanks you very much for the detailed clarification. – J. Doe Aug 6 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.