Animated GIFs dimensions super height

default discord avatar
arielarial
6 months 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
    arielarial
    6 months ago

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

    image.png
  • default discord avatar
    notchr
    6 months 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
    arielarial
    6 months ago

    :/

  • default discord avatar
    notchr
    6 months ago

    or

  • default discord avatar
    arielarial
    6 months 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
    notchr
    6 months ago

    maybe its just a multiplication error in payload somewhere

  • default discord avatar
    arielarial
    6 months 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
    notchr
    6 months 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
    arielarial
    6 months 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 @notchr , 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.is
    6 months ago

    Hey no prob! Interested in the cause!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.