Animated gifs don't like to be ()resized

I’ve got a gallery of images and gif’s from the 90s web stored in a folder. Does the resize function create jpegs only? Anyhow, I’m struggling with some basic coding here. I want to resize all images/files except for the gifs. New to Kirby. If file == jpeg resize else if…leave it…something like this. I’m struggling with the syntax atm. Still learning. Can I alter ()resize itself to treat images differently?

<?= $project->image()->resize(400)?>
if ($image->extension() == 'gif') {
  echo $image;
}
else {
  echo $image->resize(400);
}
1 Like