pygobject / pycairo

Python bindings for cairo
https://pycairo.readthedocs.io
Other
622 stars 85 forks source link

RGBA128F (and set_hairline) not available in pycairo 1.23 in docker container #315

Closed Liquidmasl closed 1 year ago

Liquidmasl commented 1 year ago

RGBA128F and RGB96F do not seam to appear in cairo 1.23 when installing via pip in a docker container (base image python:3.9-slim).

This is a bit over my head and I am not sure if this is even the correct place to ask/tell this. sorry if not, am learning.

Am I missing libraries?

Host system; Windows 11, python 3.9

In [8]: cairo.version
Out[8]: '1.23.0'
In [9]: dir(cairo.Format)
Out[9]: 
['A1',
 'A8',
 'ARGB32',
 'INVALID',
 'RGB16_565',
 'RGB24',
 'RGB30',
 'RGB96F',
 'RGBA128F',
 ...,
] 

Container; base image: python:3.9-slim

>>> cairo.version
'1.23.0'
>>> dir(cairo.Format)
['A1',
 'A8', 
 'ARGB32',
 'INVALID',
 'RGB16_565',
 'RGB24',
 'RGB30',
 '__abs__',
 ,...
]
Liquidmasl commented 1 year ago

okay cairo.set_hairline doesnt work as well, which is also something with New in version 1.23: Only available with cairo 1.17.6+ (although that line confuses me as well, if it was new in 1.23 why was it available starting 1.17.6?) So for some reason the cairo in the container seams to be different then outside of it, but they have the same version number, and are installed in the same way. Just in different environments. What am I not understanding here?

Liquidmasl commented 1 year ago

it just dawned me that cairo and pycairo is not the same.

I have 1.17.6 on the host machine, but not in docker. Not sure why RUN apt-get update && apt-get install -y gcc libcairo2 libcairo2-dev libjpeg-dev libgif-dev did get an older version. I also cant seam to find 1.17.6 on https://www.cairographics.org/releases/ except for rcairo. So I don't see how I could build from source in the container.

Where did my host machine get it from?

Anyway this is way above my head sadly, I will hope hairline is the last feature I needed from the newest version. Any help would be appreciated!

lazka commented 1 year ago

Snapshot releases are here: https://www.cairographics.org/snapshots/

python:3.9-slim is based on Debian bullseye, which only has cairo 1.16.0

Liquidmasl commented 1 year ago

Snapshot releases are here: https://www.cairographics.org/snapshots/

python:3.9-slim is based on Debian bullseye, which only has cairo 1.16.0

that solves that, thank you