Skip to content

High memory usage when resizing a large image to 1x1 #4170

@dloebl

Description

@dloebl

Bug report

Describe the bug
The memory usage seems to be exceptionally high when resizing large input images to a small dimension. For example:
Resizing a PNG with a dimension of 30000x30000 to 1x1 with vipsthumbnail consumes about 18 GB max, but resizing the same input image to 15000x15000 requires just about 0.8 GB.

To Reproduce
Steps to reproduce the behavior:

  1. Create the input image:
vips black --bands 4 black.png 30000 30000
  1. Resize the image to 1x1:
vipsthumbnail --size 1x1 black.png -o out.png
  1. The maximum memory usage is at about 18 GB:
gtime -f%M vipsthumbnail --size 1x1 black.png -o out.png

18228176

Environment

  • OS: MacOS 14.6
  • Vips: v8.15.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions