TransWikia.com

Why doesn't gir1.2-vips-8.0 contain Vips.Image.grey?

Ask Ubuntu Asked by int_ua on January 2, 2021

When installed via pyvips into a venv Vips.Image.grey is working but with gir1.2-vips-8.0 this code fails because grey is not found:

import gi
gi.require_version('Vips', '8.0')
from gi.repository import Vips

null_image = Vips.Image.grey(1, 1)

Edit: I specifically want to avoid using pyvips because it’s the only dependency for the script I’m running and I want to not bother about activating venv.

2 Answers

You seem to be using the old gobject-introspection Python interface. It was slow, unstable and inflexible. It will give you poor performance and frequent, inexplicable crashes.

It was replaced quite a few years ago by the much better pyvips. Just pip install pyvips, then:

import pyvips
image = pyvips.Image.grey(100, 100)

Answered by jcupitt on January 2, 2021

Because the grey is not a direct dependency of libvips or libvips42 which is in turn a dependency package gir1.2-vips-8.0.

On the other hand, if you install it via pip in an venv it is being pulled by python as a dependency.

Answered by Ron on January 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP