From f2956ac0691e0e21fbb1b84176c955199bab1e96 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 2 Oct 2020 11:20:35 +0100 Subject: [PATCH] note improvements to iprofile The docs had fallen behind a bit ... iprofile is no longer usually necessary. see https://github.com/libvips/libvips/issues/1843 --- doc/Using-vipsthumbnail.md | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/doc/Using-vipsthumbnail.md b/doc/Using-vipsthumbnail.md index 80c987de..2ac5edc4 100644 --- a/doc/Using-vipsthumbnail.md +++ b/doc/Using-vipsthumbnail.md @@ -23,6 +23,14 @@ $image = Vips\Image::thumbnail($filename, 200, ["height" => 200]); $image->writeToFile("my-thumbnail.jpg"); ``` +You can also call `thumbnail_source` from the CLI, for example: + +``` +$ cat k2.jpg | \ + vips thumbnail_source [descriptor=0] .jpg[Q=90] 128 | \ + cat > x.jpg +``` + # libvips options `vipsthumbnail` supports the usual range of vips command-line options. A @@ -282,25 +290,14 @@ high-quality sRGB profile that's built into libvips.) `tn_shark.jpg` will look identical to a user, but it's almost half the size. You can also specify a fallback input profile to use if the image has no -embedded one. This can often happen with CMYK images, producing an error -message like: +embedded one. For example, perhaps you somehow know that a JPG is in Adobe98 +space, even though it has no embedded profile. + ``` -$ vipsthumbnail kgdev.jpg -vipsthumbnail: unable to thumbnail kgdev.jpg -vips_colourspace: no known route from 'cmyk' to 'srgb' +$ vipsthumbnail kgdev.jpg --iprofile /my/profiles/a98.icm ``` -If you supply a CMYK profile, it will be able to convert the image, -for example: - -``` -$ vipsthumbnail kgdev.jpg --iprofile cmyk -``` - -(As before, the magic string `cmyk` selects a high-quality CMYK profile that's -built into libvips, but you can use any CMYK profile you like.) - # Final suggestion Putting all this together, I suggest this as a sensible set of options: @@ -309,6 +306,5 @@ Putting all this together, I suggest this as a sensible set of options: $ vipsthumbnail fred.jpg \ --size 128 \ --eprofile srgb \ - -o tn_%s.jpg[optimize_coding,strip] \ - --eprofile srgb + -o tn_%s.jpg[optimize_coding,strip] ```