gifwrap icon indicating copy to clipboard operation
gifwrap copied to clipboard

GifFrame constructor ignores options from BitmapImages

Open DetachHead opened this issue 4 years ago • 1 comments

would be good to be able to read and write frame delay, as Omggif supports it

DetachHead avatar Feb 04 '21 14:02 DetachHead

nevermind, turns out it's in GifFrame and was losing the GifFrameOptions here in my code

frames = image.frames.map(frame =>
    new GifFrame(
        (GifUtil.copyAsJimp(Jimp, frame) as Jimp).scaleToFit(maxSize, maxSize).bitmap,
        frame
    )
)

because of this check in its constructor:

image

is that meant to be there? there's no constructor type that would imply such behavior:

constructor(bitmap: JimpBitmap, options?: GifFrameOptions);
constructor(bitmapImage: BitmapImage, options?: GifFrameOptions);
constructor(width: number, height: number, buffer: Buffer, options?: GifFrameOptions);
constructor(width: number, height: number, backgroundRGBA?: number, options?: GifFrameOptions);
constructor(frame: GifFrame);

DetachHead avatar Feb 04 '21 15:02 DetachHead