davidbyttow / govips

A lightning fast image processing and resizing library for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image Resizing Failing For GIFs Frame Too Large

Hrishikesh-Thakkar opened this issue · comments

I am trying to resize the following GIF

Original Dimensions are: 1270 x 1270 and a total of 149 Pages

I am resizing to the following Dimensions:

  1. 250 x 250 (Successful)
  2. 500 x 500 (Successful)
  3. 750 x750 (Unsuccessful)

It fails for the last case and after some digging I found that the limits are set in libvips. I am not able to conclude how the dimensions are violating the constraints.

Constraints Being:
/* Reject images that exceed the pixel limit of libimagequant, * or that exceed the GIF limit of 64k per axis. * * Frame width * height will fit in an int, though frame size will * need at least a uint. */ if( (guint64) frame_rect.width * frame_rect.height > INT_MAX / 4 || frame_rect.width > 65535 || frame_rect.height > 65535 ) { vips_error( class->nickname, "%s", _( "frame too large" ) ); return( -1 ); }

Currently I have the latest govips(v2.11.0) and vips(8.13.3) versions installed.

Cross-posted on libvips and stackoverflow. I would close this issue unanswered, David.