Skip to content

avoid thumbnailImageΒ #192

@jcupitt

Description

@jcupitt

I noticed some of the sample code uses thumbnailImage, eg.:

https://github.com/lopcode/vips-ffm/blob/main/sample/src/main/kotlin/vipsffm/sample/VImageCreateThumbnailSample.kt#L32

The libvips thumbnail_image operation can be slow and is only there for emergencies. It's much better to use thumbnail, if possible. For example:

$ time vips thumbnail_image nina.jpg x.jpg 128
real	0m0.126s
user	0m0.079s
sys	0m0.049s

$ time vips thumbnail nina.jpg x.jpg 128
real	0m0.062s
user	0m0.043s
sys	0m0.020s

Because thumbnail combines open and load into a single operation, it can do tricks with many file formats to improve load time and quality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions