You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, when loading gif from string my loader is VipsForeignLoadNsgifBuffer instead of VipsForeignLoadGifBuffer. The n option is not applied correctly.
The following addition fixes the issue (for now):
protected function getLoadOptions($loader, $loadOptions = [])
{
$options = [];
switch ($loader) {
case 'VipsForeignLoadJpegFile':
case 'VipsForeignLoadJpegBuffer':
$options['autorotate'] = true;
break;
case 'VipsForeignLoadHeifFile':
case 'VipsForeignLoadHeifBuffer':
$options['autorotate'] = true;
$options['n'] = -1; // not sure this should be enabled by default, to discuss
break;
case 'VipsForeignLoadGifFile':
case 'VipsForeignLoadGifBuffer':
case 'VipsForeignLoadNsgifBuffer':
$options['n'] = -1; // not sure this should be enabled by default, to discuss
break;
}
$options = array_merge($loadOptions, $options);
// FIXME: remove not allowed options
if (isset($options['shrink'])) {
switch ($loader) {
case 'VipsForeignLoadJpegFile':
case 'VipsForeignLoadJpegBuffer':
case 'VipsForeignLoadWebpFile':
case 'VipsForeignLoadWebpBuffer':
break;
default:
unset($options['shrink']);
}
}
return $options;
}
My current vips config is:
enable debug: no
enable deprecated library components: yes
enable modules: no
use fftw3 for FFT: no
accelerate loops with orc: yes
ICC profile support with lcms: yes (lcms2)
zlib: yes
text rendering with pangocairo: no
font file support with fontconfig:
RAD load/save: yes
Analyze7 load/save: yes
PPM load/save: yes
GIF load: yes
GIF save with cgif: yes
EXIF metadata support with libexif: yes
JPEG load/save with libjpeg: yes (pkg-config)
JXL load/save with libjxl: no (dynamic module: no)
JPEG2000 load/save with libopenjp2: no
PNG load with libspng: no
PNG load/save with libpng: yes (pkg-config libpng >= 1.2.9)
quantisation to 8 bit: yes
TIFF load/save with libtiff: no
image pyramid save: yes
HEIC/AVIF load/save with libheif: no (dynamic module: no)
WebP load/save with libwebp: yes
PDF load with PDFium: no
PDF load with poppler-glib: no (dynamic module: no)
SVG load with librsvg-2.0: yes
EXR load with OpenEXR: no
OpenSlide load: no (dynamic module: no)
Matlab load with matio: no
NIfTI load/save with niftiio: no
FITS load/save with cfitsio: no
Magick package: none (dynamic module: no)
Magick API version: none
load with libMagickCore: no
save with libMagickCore: no
Should I send a PR for this fix?
The text was updated successfully, but these errors were encountered:
A PR would be fine. I actually never used libnsgif, that may be the issue why I didn't catch it. Somehow strange that there are two different loaders for that, but anyway, easy fix and no potential harm.
For some reason, when loading gif from string my loader is VipsForeignLoadNsgifBuffer instead of VipsForeignLoadGifBuffer. The n option is not applied correctly.
The following addition fixes the issue (for now):
My current vips config is:
Should I send a PR for this fix?
The text was updated successfully, but these errors were encountered: