Ankündigung

Einklappen
Keine Ankündigung bisher.

Animiertes GIF in PHP

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Animiertes GIF in PHP

    Moin,

    habe eine animierte GIF-Datei die ich in ein Bild reinkopieren möchte.

    Gibt es eine Möglichkeit ( ohne Imagick, gifmerge o.Ä. ) die Animation bezubehalten?
    Wenn ich die Datei nämlich über imagecreatefromgif öffne ist die Animation weg

    Vielen Dank
    Grüße

  • #2
    IMHO nicht.

    Kommentar


    • #3
      Zitat von nikosch Beitrag anzeigen
      IMHO nicht.
      Das hatte ich leider erwartet, da ich bei Google auch nichts dazu gefunden habe.
      Schade
      Danke für die schnelle Antwort.
      cu
      Grüße
      Destruction

      Kommentar


      • #4
        Wenns unbedingt PHP sein muß, hilft Dir dieser Ansatz vielleicht weiter?
        PHP-Code:
        function AnimatedGIF($frames=array(), $loop=0$target_file='animated.gif') {
          
        $exc '/usr/local/bin/convert -dispose none';

          foreach(
        $frames as $frame$exc .= ' -delay '.$frame['delay'].' '.$frame['file'];

          
        $exc .= ' -loop '.$loop;
          
        $exc .= ' '.dirname(__FILE__).$target_file;

          
        exec("$exc 2>&1"$err);
        }


        $images = array(
          array(
        'file'=>'frame1.jpg''delay'=>3),
          array(
        'file'=>'frame2.jpg''delay'=>3),
          array(
        'file'=>'frame3.jpg''delay'=>3),
          array(
        'file'=>'frame4.jpg''delay'=>3),
          array(
        'file'=>'frame5.jpg''delay'=>3)
        );


        AnimatedGIF($images0); 
        stammt übrigens nicht von mir!

        Kommentar


        • #5
          Die gdlib kann zwar mit animierten Gifs umgehen, aber die Implementierung in PHP scheint das nicht zu nutzt:

          GD Library FAQ
          Update: please note that PHP may or may not have been updated yet to include support for the GIF and animated GIF features that have been added to gd. See PHP: Hypertext Preprocessor for the official word on what is and isn't standard in PHP's internal version of gd at this time.

          Kommentar

          Lädt...
          X