"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "doc/Using-vipsthumbnail.md" between
vips-8.10.6.tar.gz and vips-8.11.0.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

Using-vipsthumbnail.md  (vips-8.10.6):Using-vipsthumbnail.md  (vips-8.11.0)
skipping to change at line 26 skipping to change at line 26
`vips_thumbnail_buffer()` (which thumbnails an image held as a string), `vips_thumbnail_buffer()` (which thumbnails an image held as a string),
see the docs for details. You can use these functions from any language see the docs for details. You can use these functions from any language
with a libvips binding. For example, from PHP you could write: with a libvips binding. For example, from PHP you could write:
```php?start_inline=1 ```php?start_inline=1
$filename = "image.jpg"; $filename = "image.jpg";
$image = Vips\Image::thumbnail($filename, 200, ["height" => 200]); $image = Vips\Image::thumbnail($filename, 200, ["height" => 200]);
$image->writeToFile("my-thumbnail.jpg"); $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 # libvips options
`vipsthumbnail` supports the usual range of vips command-line options. A `vipsthumbnail` supports the usual range of vips command-line options. A
few of them are useful: few of them are useful:
`--vips-cache-trace` shows each operation as libvips starts it. It can be `--vips-cache-trace` shows each operation as libvips starts it. It can be
handy to see exactly what operations `vipsthumbnail` is running for you. handy to see exactly what operations `vipsthumbnail` is running for you.
`--vips-leak` turns on the libvips memory leak checker. As well as reporting `--vips-leak` turns on the libvips memory leak checker. As well as reporting
leaks (hopefully there are none) it also tracks and reports peak memory use. leaks (hopefully there are none) it also tracks and reports peak memory use.
skipping to change at line 274 skipping to change at line 282
``` ```
$ vipsthumbnail shark.jpg $ vipsthumbnail shark.jpg
$ ls -l tn_shark.jpg $ ls -l tn_shark.jpg
-rw-r–r– 1 john john 7295 Nov  9 14:33 tn_shark.jpg -rw-r–r– 1 john john 7295 Nov  9 14:33 tn_shark.jpg
``` ```
Now transform to sRGB and don't attach a profile (you can also use `strip`, Now transform to sRGB and don't attach a profile (you can also use `strip`,
though that will remove *all* metadata from the image): though that will remove *all* metadata from the image):
``` ```
$ vipsthumbnail shark.jpg --eprofile srgb -o tn_shark.jpg[profile=none] $ vipsthumbnail shark.jpg --export-profile srgb -o tn_shark.jpg[profile=none]
$ ls -l tn_shark.jpg $ ls -l tn_shark.jpg
-rw-r–r– 1 john john 4229 Nov  9 14:33 tn_shark.jpg -rw-r–r– 1 john john 4229 Nov  9 14:33 tn_shark.jpg
``` ```
(You can use the filename of any RGB profile. The magic string `srgb` selects a (You can use the filename of any RGB profile. The magic string `srgb` selects a
high-quality sRGB profile that's built into libvips.) 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. `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 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 embedded one. For example, perhaps you somehow know that a JPG is in Adobe98
message like: space, even though it has no embedded profile.
``` ```
$ vipsthumbnail kgdev.jpg $ vipsthumbnail kgdev.jpg --input-profile /my/profiles/a98.icm
vipsthumbnail: unable to thumbnail kgdev.jpg
vips_colourspace: no known route from 'cmyk' to 'srgb'
``` ```
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 # Final suggestion
Putting all this together, I suggest this as a sensible set of options: Putting all this together, I suggest this as a sensible set of options:
``` ```
$ vipsthumbnail fred.jpg \ $ vipsthumbnail fred.jpg \
--size 128 \ --size 128 \
--eprofile srgb \ --export-profile srgb \
-o tn_%s.jpg[optimize_coding,strip] \ -o tn_%s.jpg[optimize_coding,strip]
--eprofile srgb
``` ```
 End of changes. 6 change blocks. 
19 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)