python-liblcms: python bindings defective

Bug #178033 reported by Guy K. Kloss
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sK1
Fix Released
Undecided
geshade
lcms (Ubuntu)
Confirmed
Undecided
geshade

Bug Description

Binary package hint: python-liblcms

* installing liblcms1 and python-liblcms
* the module "lcms" from the python bindings to LittleCMS are available, but they do not seem to contain any bindings to the actual liblcms1 library
* try the following in the interactive python interpreter:

$ python
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lcms
>>> foo = lcms.cmsCIEXYZ()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'cmsCIEXYZ'
>>>

Compilation of lcms-1.17 from the original sources (http://littlecms.com) using the configure flag --with-python yields proper bindings.

Revision history for this message
Oleksandr Moskalenko (malex) wrote :

$ python
Python 2.4.4 (#2, Aug 16 2007, 02:03:40)
[GCC 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lcms import lcms
>>> foo = lcms.cmsCIEXYZ()
>>> foo
XYZ [0, 0, 0]

Notice the way it's imported.

Regards,

Alex

(Debian liblcms maintainer)

Revision history for this message
Oleksandr Moskalenko (malex) wrote :

Not a bug as far as I can tell. The import is just different.

Changed in lcms:
status: New → Invalid
Revision history for this message
Guy K. Kloss (guy.kloss) wrote :

The import at least works on self compiled binaries "properly" (as in the usual way).

And shouldn't imports work homogeneously in the Python language environment. I believe that's one of the reasons why it is so popular.

Revision history for this message
Guy K. Kloss (guy.kloss) wrote :

Oleksandr Moskalenko (Debian lcms package maintainer) has just uploaded a package into Debian/unstable that has the expected "import lcms" behaviour. This will now have to make it into Ubuntu ...

Changed in lcms:
status: Invalid → Confirmed
Revision history for this message
Olivier Berten (olivier-berten) wrote :

With version 1.16-10 it doesn't import anything anymore...

Python 2.5.2 (r252:60911, Jun 28 2008, 14:35:19)
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lcms import *
>>> dir()
['__builtins__', '__doc__', '__name__']
>>> from lcms.lcms import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named lcms
>>> import lcms
>>> dir()
['__builtins__', '__doc__', '__name__', 'lcms']
>>> dir(lcms)
['__builtins__', '__doc__', '__file__', '__name__', '__path__']
>>>

Revision history for this message
Oleksandr Moskalenko (malex) wrote : Re: [Bug 178033] Re: python-liblcms: python bindings defective

* Olivier Berten <email address hidden> [2008-07-04 18:21:31 -0000]:

> With version 1.16-10 it doesn't import anything anymore...

I just uploaded a new release 1.17-1 into Debian/unstable. "import lcms" works
fine there.

Cheers,

Alex.

> Python 2.5.2 (r252:60911, Jun 28 2008, 14:35:19)
> [GCC 4.3.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from lcms import *
> >>> dir()
> ['__builtins__', '__doc__', '__name__']
> >>> from lcms.lcms import *
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named lcms
> >>> import lcms
> >>> dir()
> ['__builtins__', '__doc__', '__name__', 'lcms']
> >>> dir(lcms)
> ['__builtins__', '__doc__', '__file__', '__name__', '__path__']
> >>>
>
> --
> python-liblcms: python bindings defective
> https://bugs.launchpad.net/bugs/178033
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
pr100 (paul-rudin) wrote :

import lcms works, but the module doesn't actually have anything in it.

Revision history for this message
pr100 (paul-rudin) wrote :

or actually, it does, but you have to do "from lcms import lcsm", where normally people would just expect "import lcms"

Revision history for this message
Guy K. Kloss (guy.kloss) wrote :

An easy fix that would be worth putting into the package distribution:

Just remove the two Python packages, as all that's needed is found in the module lcms.py anyway. The dualism in the name space (package and module of same name) overshadow each other and hinder a seamless working. So, these directories (for the Python packages) need to be removed, and everything should work:

 * /usr/share/python-support/python-liblcms/lcms
 * /var/lib/python-support/python2.5/lcms

Hope that helps,

Guy

Revision history for this message
igor.e.novikov (igor-e-novikov) wrote :

Hi all!

The bug is marked as affected on sK1. Actually we have resolved this issue. Official lcms python binding is a SWIG generated stubs. It's not a best solution for sK1. So we have created own lcms binding with improved performance and optimized code. Naturally our extension is compiled without any similar problems. Here is a source code which will be included in next release:

http://sk1.svn.sourceforge.net/viewvc/sk1/trunk/subprojects/pycms/

Therefore the bug is not important for sK1 project.

Regards,

Igor Novikov
sK1 Project
http://sk1project.org

geshade (geshade)
Changed in lcms (Ubuntu):
status: Confirmed → Fix Released
status: Fix Released → Confirmed
status: Confirmed → Fix Committed
status: Fix Committed → Confirmed
assignee: nobody → geshade (geshade)
geshade (geshade)
Changed in sk1:
assignee: nobody → geshade (geshade)
status: New → Confirmed
Revision history for this message
igor.e.novikov (igor-e-novikov) wrote :

We have implemented own lcms binding optimized for vector graphics (located in sk1libs), so this issue has not affected on sK1.

Changed in sk1:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.