Skip to content

Thumbnail width for portrait images #71

Open
libvips/libvips
#1639
@boris612

Description

@boris612

ThumbnailImage method allows a user to specify only width, but it does not work correctly for portrait images (or it is not correctly documented)
For example, if you write the following code

var image = Image.NewFromFile(filename);
Image thumbnail = image.ThumbnailImage(300);

for the image with dimensions 600x900 then it would produce 200x300 thumbnail instead of 300x450.
It appears that it translates to vipsthumbnail.exe -s 300 instead to vipsthumbnail.exe -s 300x

A workaround is to calculate height or to give some large value for height
Image thumbnail = image.ThumbnailImage(300, height: a big enough number)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions