How to make that when uploading pictures to the server, if it is animated, remove this animation? Even if the user stupidly renames the image extension.

    2 answers 2

    StackOverflow: How to convert?

      Change the extension. If (file extension == .gif) {file = filename.jpg}

      • And if I changed the animation gif on jpg then the condition does not work and it is not desirable to change the extension of the downloaded files - Fangog
      • 1. What condition does not work? 2. Why it is not desirable to change the extension? By the way, on the other animated gifchik you will not be forced to be static. Love to complicate? Then create a copy of the image with the first frame. Learn more - find here (imagecreatefromgif) . Only in this case, the extension will have to change. Or do double work: from gif to png , from png to gif - Deonis