Oh, very good.
Yes, the point is to position the canvas at the necessary size to fit all the frames of the longest animation.
For example, if your tiles are 16x32, and the longest animation has 12 frames, then I would make the canvas 190 px Although other animations may have fewer frames, it's a basic way, because there are other ways but you can start there.
By the way, the Sprite Sheet doesn't have the logic you indicated; it has a very strange logic.