Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Animated GIFs dimensions super height

default discord avatar
arielarial2 years ago
11

Hey guys! Just checking if this is intended behavior:


When I upload an animated GIF, Payload reads its dimensions summing every frame height, making it super taller. In this case, it is a 2560x1440 file, but it is as 2560x97920 (68 frames)

  • default discord avatar
    arielarial2 years ago

    I think its something deeper than that, because I'm getting this value when calling on API:

  • default discord avatar
    notchr2 years ago

    Sharp used to have a pageHeight prop on gifs



    I think it restrained the gif from being the height of the total frames



    But it's not a config prop anymore for gif

  • default discord avatar
    arielarial2 years ago

    :/

  • default discord avatar
    notchr2 years ago

    or

  • default discord avatar
    arielarial2 years ago

    the imageSizes dimensions are ok, though. In most cases I'm getting dimensions values from there - I'm using a "full" image size, which is 2560 x free. But for smaller files, Payload won't upscale and so I end up getting width/height from the original file. Which is messed up in GIFs

  • default discord avatar
    notchr2 years ago

    maybe its just a multiplication error in payload somewhere

  • default discord avatar
    arielarial2 years ago

    by the way, are animated gifs working for you? The changelog for 1.6.17 says that payload is properly resizing animated images, but imageSizes are still just the first frame of GIFs

  • default discord avatar
    notchr2 years ago

    Well first I'd check a cpl things



    Payload uses

    probe-image-size


    to check image dimensions quickly



    You could see if parsing your gif with that module produces incorrect dimensions



    Then we could rule that out

  • default discord avatar
    arielarial2 years ago

    Nice, I'll check that. I have a meting in a few minutes, but will get back to this and give you updates, thanks!



    hi

    @1049775120559898725

    , just to keep you posted here. I ended up finding a work around to this problem, and had to drop this debugging for now. This product will (hopefully) launch this week, so I'm a little short on time. But will definitely get back here to find out why this is happening, and why my payload won't crop animated gifs properly. Thanks again!

  • default discord avatar
    notchr.is2 years ago

    Hey no prob! Interested in the cause!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.