Matplotlib 2.2.2 - unclear license conditions for _png.cpp

Dear Matplotlib developers,
For one of our products we want to use Matplotlib 2.2.2. In order to distribute our product in a license compliant way we check the licenses of all OSS source code we are using. We do this on an file by file basis. For the file _png.cpp we have not been able to determine license situation. In file header we found the following text:
// this code is heavily adapted from the paint license, which is in
4. // the file paint.license (BSD compatible) included in this
5. // distribution. TODO, add license file to MANIFEST.in and CVS
6.
7. /* For linux, png.h must be imported before Python.h because
8. png.h needs to be the one to define setjmp.
9. Undefining _POSIX_C_SOURCE and _XOPEN_SOURCE stops a couple
10. of harmless warnings.
We could not find the file "paint.license", i.e. we do not know the correct license for _png.cpp. Can you please help us in order to get the correct license for _png.cpp
Thanks a lot in advance and kind regards
  Johann Arnold

Siemens AG
Digital Industries
Process Automation
Software House Nbg
DI PA CI R&D 3
Gleiwitzer Str. 555
90475 N?rnberg, Deutschland
Tel.: +49 911 895-3162
Fax: +49 911 895-4010
mailto:johann.arnold at siemens.com
www.siemens.com/ingenuityforlife<https://siemens.com/ingenuityforlife>
[www.siemens.com/ingenuityforlife]
Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Jim Hagemann Snabe; Vorstand: Joe Kaeser, Vorsitzender; Roland Busch, Lisa Davis, Klaus Helmrich, Janina Kugel, Cedrik Neike, Michael Sen, Ralf P. Thomas; Sitz der Gesellschaft: Berlin und M?nchen, Deutschland; Registergericht: Berlin Charlottenburg, HRB 12300, M?nchen, HRB 6684; WEEE-Reg.-Nr. DE 23691322
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190510/58b8ac86/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 3536 bytes
Desc: image001.gif
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190510/58b8ac86/attachment.gif>

Johann,

Thank you for being patient with us.

TLDR: the relevant license file is

/******************************************************************
Copyright 2000 by Object Craft P/L, Melbourne, Australia.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Object Craft
is not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.

OBJECT CRAFT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL OBJECT CRAFT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

******************************************************************/

(also attached)

···

----

It looks like this comment came in via

in
2004 by JDH.

It was then showes up a second time in 2004

again
by JDH.

It was then moved around by MD in

and

which
deleted both of the other uses and unified t to it's current location in
`_png.cpp` in 2008.

It looks like that comment was moved from the write function to the top of
the file in

.
I think that this was unintentional and the comment should still just apply
to the png writing function.

I have pulled out the 3 versions this function when they came into the code
base and attached them as v1.cpp, v2.cpp, and v3.cpp and the current state
of the function in v4.cpp (re-formatted to all have the same indentation).

Although it never made it into version control, the license file was
included in the source releases of Matplotlib (

)
which eventually gets us back to the source:
Python Paint Module - Object Craft and I have attached the
relevant function as v0.cpp

Tom

On Fri, May 10, 2019 at 5:04 AM Arnold, Johann <johann.arnold at siemens.com> wrote:

Dear Matplotlib developers,

For one of our products we want to use Matplotlib 2.2.2. In order to
distribute our product in a license compliant way we check the licenses of
all OSS source code we are using. We do this on an file by file basis. For
the file _png.cpp we have not been able to determine license situation. In
file header we found the following text:

// this code is heavily adapted from the paint license, which is in
4. // the file paint.license (BSD compatible) included in this
5. // distribution. TODO, add license file to MANIFEST.in and CVS
6.
7. /* For linux, png.h must be imported before Python.h because
8. png.h needs to be the one to define setjmp.
9. Undefining _POSIX_C_SOURCE and _XOPEN_SOURCE stops a couple
10. of harmless warnings.

We could not find the file ?paint.license?, i.e. we do not know the
correct license for _png.cpp. Can you please help us in order to get the
correct license for _png.cpp

Thanks a lot in advance and kind regards
  Johann Arnold

Siemens AG
Digital Industries
Process Automation
Software House Nbg
DI PA CI R&D 3
Gleiwitzer Str. 555
90475 N?rnberg, Deutschland
Tel.: +49 911 895-3162
Fax: +49 911 895-4010
mailto:johann.arnold at siemens.com <johann.arnold at siemens.com>
www.siemens.com/ingenuityforlife <https://siemens.com/ingenuityforlife&gt;
[image: www.siemens.com/ingenuityforlife]
Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Jim Hagemann
Snabe; Vorstand: Joe Kaeser, Vorsitzender; Roland Busch, Lisa Davis, Klaus
Helmrich, Janina Kugel, Cedrik Neike, Michael Sen, Ralf P. Thomas; Sitz der
Gesellschaft: Berlin und M?nchen, Deutschland; Registergericht: Berlin
Charlottenburg, HRB 12300, M?nchen, HRB 6684; WEEE-Reg.-Nr. DE 23691322
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel at python.org
Matplotlib-devel Info Page

--
Thomas Caswell
tcaswell at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0001.html&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 3536 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0001.gif&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1.cpp
Type: text/x-c++src
Size: 2166 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0005.cpp&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v3.cpp
Type: text/x-c++src
Size: 3931 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0006.cpp&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2.cpp
Type: text/x-c++src
Size: 2107 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0007.cpp&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4.cpp
Type: text/x-c++src
Size: 10176 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0008.cpp&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v0.cpp
Type: text/x-c++src
Size: 1657 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0009.cpp&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LICENSE_PAINT
Type: application/octet-stream
Size: 1148 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/78290b8e/attachment-0001.obj&gt;

Slight follow up (I was so happy to find the license I sent the email
before crossing all of the is and dotting all of the ts), the license file
did make it into version control via

but was accidentally removed in

.

I am in the process of putting in a PR to restore LICENSE_PAINT.

Tom

···

On Sun, Jun 2, 2019 at 3:47 PM Thomas Caswell <tcaswell at gmail.com> wrote:

Johann,

Thank you for being patient with us.

TLDR: the relevant license file is

/******************************************************************
Copyright 2000 by Object Craft P/L, Melbourne, Australia.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Object Craft
is not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.

OBJECT CRAFT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL OBJECT CRAFT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

******************************************************************/

(also attached)

----

It looks like this comment came in via
reorganized table · matplotlib/matplotlib@6cc5c32 · GitHub in
2004 by JDH.

It was then showes up a second time in 2004
image fix, line collection extension · matplotlib/matplotlib@9c2d9c3 · GitHub again
by JDH.

It was then moved around by MD in
Fix some mathtext scaling bugs · matplotlib/matplotlib@22e2a42 · GitHub
and
Forgot this file · matplotlib/matplotlib@26a14a3 · GitHub which
deleted both of the other uses and unified t to it's current location in
`_png.cpp` in 2008.

It looks like that comment was moved from the write function to the top of
the file in
Remove use of PyCXX in core C++ extensions · matplotlib/matplotlib@ba40160 · GitHub .
I think that this was unintentional and the comment should still just apply
to the png writing function.

I have pulled out the 3 versions this function when they came into the
code base and attached them as v1.cpp, v2.cpp, and v3.cpp and the current
state of the function in v4.cpp (re-formatted to all have the same
indentation).

Although it never made it into version control, the license file was
included in the source releases of Matplotlib (
matplotlib - Browse /matplotlib-maintenance/matplotlib-0.91.1 at SourceForge.net )
which eventually gets us back to the source:
Python Paint Module - Object Craft and I have attached the
relevant function as v0.cpp

Tom

On Fri, May 10, 2019 at 5:04 AM Arnold, Johann <johann.arnold at siemens.com> > wrote:

Dear Matplotlib developers,

For one of our products we want to use Matplotlib 2.2.2. In order to
distribute our product in a license compliant way we check the licenses of
all OSS source code we are using. We do this on an file by file basis. For
the file _png.cpp we have not been able to determine license situation. In
file header we found the following text:

// this code is heavily adapted from the paint license, which is in
4. // the file paint.license (BSD compatible) included in this
5. // distribution. TODO, add license file to MANIFEST.in and CVS
6.
7. /* For linux, png.h must be imported before Python.h because
8. png.h needs to be the one to define setjmp.
9. Undefining _POSIX_C_SOURCE and _XOPEN_SOURCE stops a couple
10. of harmless warnings.

We could not find the file ?paint.license?, i.e. we do not know the
correct license for _png.cpp. Can you please help us in order to get the
correct license for _png.cpp

Thanks a lot in advance and kind regards
  Johann Arnold

Siemens AG
Digital Industries
Process Automation
Software House Nbg
DI PA CI R&D 3
Gleiwitzer Str. 555
90475 N?rnberg, Deutschland
Tel.: +49 911 895-3162
Fax: +49 911 895-4010
mailto:johann.arnold at siemens.com <johann.arnold at siemens.com>
www.siemens.com/ingenuityforlife <https://siemens.com/ingenuityforlife&gt;
[image: www.siemens.com/ingenuityforlife]
Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Jim Hagemann
Snabe; Vorstand: Joe Kaeser, Vorsitzender; Roland Busch, Lisa Davis, Klaus
Helmrich, Janina Kugel, Cedrik Neike, Michael Sen, Ralf P. Thomas; Sitz der
Gesellschaft: Berlin und M?nchen, Deutschland; Registergericht: Berlin
Charlottenburg, HRB 12300, M?nchen, HRB 6684; WEEE-Reg.-Nr. DE 23691322
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel at python.org
Matplotlib-devel Info Page

--
Thomas Caswell
tcaswell at gmail.com

--
Thomas Caswell
tcaswell at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/036ddace/attachment.html&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 3536 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20190602/036ddace/attachment.gif&gt;