qtpy icon indicating copy to clipboard operation
qtpy copied to clipboard

PR: Add utility function to get raw bytes from QImages (compat.py)

Open zjp opened this issue 2 years ago • 13 comments

We use this utility function in ChimeraX to grab the raw content of a QImage to pass to our renderer. I'm hoping it will be useful to other users as well, and I'm open to feedback about how to make that possible.

zjp avatar Jul 16 '22 17:07 zjp

Thanks @zjp ! Then this is comming from ChimeraX source code, right? Is there any licensing we should know about?

If that is the case I would say that the license should be compatible with MIT (the license we use here) and we should add a note in the function pointing out from where the function is comming from.

Besides that adding a tests for this could be nice too :)

Maybe @CAM-Gerlach and/or @ccordoba12 have more elements to have in mind.

dalthviz avatar Jul 18 '22 16:07 dalthviz

There's an equivalent function but it needed adaptation to your project. There's no licensing concerns on your end -- my goal is to upstream this code and remove it from ChimeraX.

I'll add tests!

zjp avatar Jul 18 '22 17:07 zjp

@zjp, this has a conflict with master now.

ccordoba12 avatar Jul 22 '22 21:07 ccordoba12

When I get a chance I'll rebase thanks for letting me know!

zjp avatar Jul 22 '22 22:07 zjp

Thanks @zjp ! Then this is comming from ChimeraX source code, right? Is there any licensing we should know about?

If @zjp is the author or otherwise holds the copyright, then by submitting it here they are agreeing to license it under QtPy's license, presuming that corporate contracts don't get in the way. Otherwise, there could theoretically be an issue, but while IANAL and this is not legal advice, the code is probably too short/simple to be covered by copyright protection as an independent work.

I'll add tests!

Looking forward to it!

CAM-Gerlach avatar Jul 23 '22 00:07 CAM-Gerlach

Thanks @zjp for giving this an update! Just in case, seems like the failing checks are related with https://github.com/coverallsapp/github-action/issues/205

dalthviz avatar Apr 22 '24 19:04 dalthviz

I still need to add a test for this function. Do you think it's better to add a small image to the repository, to fetch an image from the internet in the test, or to do a secret third thing?

zjp avatar Apr 23 '24 18:04 zjp