pyvips
pyvips copied to clipboard
vips_colourspace: no known route from 'labs' to 'rgb'
pyvips.error.Error: unable to call sharpen
vips_colourspace: no known route from 'labs' to 'rgb'
Hello, you need to give more information.
- libvips version
- pyvips version
- platform
- complete, runnable code sample that shows the problem
- any images the program needs to run
AH! Sorry. libvips: 8.8.2 pyvips: 2.1.8 platform: ubuntu 16.04 Image: Imgur
import requests
import pyvips
image_content = requests.get("https://i.imgur.com/rpm6DLE.jpg").content
image = pyvips.Image.new_from_buffer(image_content)
if image.get_typeof("icc-profile-data") != 0:
image = image.icc_transform("srgb", embedded=True, input_profile="srgb")
image = pyvips.Image.sharpen(image, sigma=1, y2=2, y3=2, m1=0, m2=0.9)
@jcupitt I'm sure this exception caused by method icc_transform
.
Try to update your libvips version to 8.8.3 (or even better 8.8.4), this bug was introduced in 8.8.2. See: https://github.com/libvips/libvips/commit/46212e92b1f943e6852e807db1ee6e5ca66b6ccf#r34904985
@jcupitt I guess we still need the RGB -> sRGB conversion on master?:
if( old_interpretation == VIPS_INTERPRETATION_RGB )
old_interpretation = VIPS_INTERPRETATION_sRGB;
https://github.com/libvips/libvips/blob/1ee54bfa80a4d940b6988d76edcbca025039d286/libvips/convolution/sharpen.c#L196
OK, this should be fixed (again) in git master and therefore in 8.9.
Instead of:
image = pyvips.Image.sharpen(image, sigma=1, y2=2, y3=2, m1=0, m2=0.9)
You can just write:
image = image.sharpen(sigma=1, y2=2, y3=2, m1=0, m2=0.9)
I expect you know.
I'm trying to upgrade libvips version to 8.8.4.
An error occured in make
.
libvips-cpp.so.42 -o .libs/libvips-cpp.so.42.11.3
libtool: link: (cd ".libs" && rm -f "libvips-cpp.so.42" && ln -s "libvips-cpp.so.42.11.3" "libvips-cpp.so.42")
libtool: link: (cd ".libs" && rm -f "libvips-cpp.so" && ln -s "libvips-cpp.so.42.11.3" "libvips-cpp.so")
libtool: link: ar cru .libs/libvips-cpp.a VImage.o VInterpolate.o VError.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libvips-cpp.a
/bin/sed: can't read /usr/lib/x86_64-linux-gnu/libfreetype.la: No such file or directory
libtool: error: '/usr/lib/x86_64-linux-gnu/libfreetype.la' is not a valid libtool archive
Makefile:620: recipe for target 'libvips-cpp.la' failed
I already have libfreetype installed.
~# apt-get install libfreetype6-dev
~# Reading package lists... Done
~# Building dependency tree
~# Reading state information... Done
~# libfreetype6-dev is already the newest version (2.9.1-3).
~# 0 upgraded, 0 newly installed, 0 to remove and 81 not upgraded.
build options:
* build options
native win32: no
native OS X: no
open files in binary mode: no
enable debug: no
enable deprecated library components: yes
enable docs with gtkdoc: no
gobject introspection: no
enable radiance support: yes
enable analyze support: yes
enable PPM support: yes
* optional dependencies
use fftw3 for FFT: no
Magick package: MagickCore
Magick API version: magick7
load with libMagick: yes
save with libMagick: yes
accelerate loops with orc: no
(requires orc-0.4.11 or later)
ICC profile support with lcms: yes (lcms2)
file import with niftiio: no
file import with libheif: no
file import with OpenEXR: yes
file import with OpenSlide: no
(requires openslide-3.3.0 or later)
file import with matio: no
PDF import with PDFium no
PDF import with poppler-glib: no
(requires poppler-glib 0.16.0 or later)
SVG import with librsvg-2.0: yes
(requires librsvg-2.0 2.34.0 or later)
zlib: yes
file import with cfitsio: no
file import/export with libwebp: no
(requires libwebp, libwebpmux, libwebpdemux 0.5.0 or later)
text rendering with pangoft2: yes
file import/export with libpng: yes (pkg-config libpng >= 1.2.9)
(requires libpng-1.2.9 or later)
support 8bpp PNG quantisation: yes
(requires libimagequant)
file import/export with libtiff: yes (pkg-config libtiff-4)
file import/export with giflib: yes (found by search)
file import/export with libjpeg: yes (pkg-config)
image pyramid export: yes
(requires libgsf-1 1.14.26 or later)
use libexif to load/save JPEG metadata: yes
libvips doesn't ask for libfreetype directly (it asks for pangoft2 for text rendering), so I think this must be a bug in one of the packages that libvips is using.
I would try configuring libvips with --without-pangoft2
and see if that fixes it.
If not, I would then try --without-magick
, since ImageMagick has a very long list of dependencies.
You could also experiment with disabling rsvg, since that will pull in text rendering.
I tried with ./configure --without-rsvg
and ./configure --without-pangoft2
, it's not working.
Try --without-magick
too.
If you can make a dockerfile which reproduces this problem, I could check.
--without-magick
is working. Will this slow down libvips speed when read, resize, crop or sharpen and so on?
That's great! I guess the imagemagick package has a bug.
Imagemagick is used to load formats like BMP and ICO, and to save GIF, so there's no effect on speed.