Animated gif. How to play in D7?

Hi - I thought by D7 that playing of animated gifs in photos throughout the site would be possible.

Does anyone know if there is a setting for this or how to make it happen?

Especially in the photo albums, comments, avatars, etc.

thx ~
D.V.

Quote · 25 Aug 2010

Hi

Dolphin 7.0.2 allow animate image like , GIF

Check your settings >> http://www.yoursite.com/m/photos/administration/settings

 

Allowed extensions: jpg png gif

 

Work for me

 

Hi - I thought by D7 that playing of animated gifs in photos throughout the site would be possible.

Does anyone know if there is a setting for this or how to make it happen?

Especially in the photo albums, comments, avatars, etc.

thx ~
D.V.

 

Post Reply - if you going to help - No for - bla bla bla bla
Quote · 25 Aug 2010

Nope - I have that set to allow gifs.
I upload an animated gif to a picture folder.
It appears but is not animated.
If I then save this image to my harddrive and open it it is no longer animated.
So the system is 'flattening' it on upload I guess.

Any hints as to how to fix?

Quote · 25 Aug 2010

I have also asked about this previously. I checked my settings and they also say " jpg png gif "

Is it possible that they need to be like .jpg .png .gif before saving?

 

I did find out that if you go to a photo and click on View Original, the photo opens a new window and actually animates.

My signature can beat up your signature!
Quote · 26 Aug 2010

D7 due to it's operation and i believe to maintain compatibility with the cooliris plugin all files during upload are converted to jpg. This conversion process will of course ruin an animated gif.

The only suggestion i can make is to try renaming the gif to jpg before upload. Most modern web browsers don't pay attention to the extension of the file when displaying it so as long as dolphin does not try to convert the jpg then in theory it should work. But you never know.

https://www.deanbassett.com
Quote · 26 Aug 2010

If you rename it to .jpg it saves the file as a single framed photo from what I remember.

My signature can beat up your signature!
Quote · 26 Aug 2010

A simple rename does not do that. If you were to open it with a photo editor such as photoshop and save it as a jpg then yes it would be converted to jpg and the result is one frame. But a rename does not do that.

But the process might not work anyway becuse dolphin has to create thumbnails of the origional image which still may result in a conversion.

https://www.deanbassett.com
Quote · 26 Aug 2010

This is the resizing process (GD library) that "freeze" any animated gif...

If you view animated gif in its original size, it is still animated :-) 

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 26 Aug 2010

It does not work anyway.(Just Tested) The animation is lost when dolphin creates thumbnails of the image. So none of the reduced images animate. Only the original file.

https://www.deanbassett.com
Quote · 26 Aug 2010

In a site i designed in the past i resized images on the fly keeping only the original. And my resize procedure was not really resizing the photo. What i did was use the gd library to get the original photos size then ran it through a function i created that generated me an html img tag where the height and width was within the parameters i specified maintaining aspect ratio. I never cropped images to get a perfect square.

My procedure had the advantage of only having to keep the original image on the server, and the browser showed the image in the size i specified through a dynamically generated img tag. Thus animated gifs would still work.

I don't understand why dolphin does not use a procedure like this. The only reason i can think of is the load time for smaller presized images would be lower, so page load times would be faster. But i still prefer on the fly image resizing.

https://www.deanbassett.com
Quote · 26 Aug 2010

Wow so Dolphin still cannot handle animated gif Avatars, icons, etc.
Cry Cry Cry

 

 

Quote · 27 Aug 2010

That's ok... animated gifs are one of the most annoying things ever invented.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 27 Aug 2010

I disagree!

I was heavily involved in another social networking site that used .gif avatars. The members ate it up!

They loved using the animated pics as default photo's because they could then get creative and make their own animations (via web cams and addon on programs, different generators, etc). Then it seemed to get to the point where someone always had to have the better avatar (aka default pic)

You see where Im going with this? Using .gif files on the sie could actually benefit some of us!

My signature can beat up your signature!
Quote · 27 Aug 2010

 

That's ok... animated gifs are one of the most annoying things ever invented.

What about APNG?

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 27 Aug 2010

I just tried to test an APNG and it didnt work either. Heres is an example http://tiny.cc/mojdf

The ony way to see the animation is to click on View Original located under the " Actions " section on the left of the page

My signature can beat up your signature!
Quote · 27 Aug 2010

 

I just tried to test an APNG and it didnt work either. Heres is an example http://tiny.cc/mojdf

The ony way to see the animation is to click on View Original located under the " Actions " section on the left of the page

If GIF didn't work, what made you think APNG would?

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 27 Aug 2010

I thought you were making a suggestion Foot in mouth

My signature can beat up your signature!
Quote · 27 Aug 2010

If you want to make this work, I think you need to update the function that is resizing / converting images and add a bypass for gifs.

Should be easily manageable as long as the site is not only expecting a jpg at the end.

Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life
Quote · 27 Aug 2010

Say WHAT!?!

LOL

My signature can beat up your signature!
Quote · 27 Aug 2010

Animated avatars are so popular that the disappointment a member has in finding out that their super cool animated avatar doesnt work is probably enough to make them swear of pathetic MySpace and Facebook imitation Dolphin sites and go back to the real thing! Damn all that work I put into following the new tutorial to create my own FB site wasted :P

 

Quote · 28 Aug 2010

Leather... English please? lol

My signature can beat up your signature!
Quote · 30 Aug 2010

This is my function. There are many like it, but this one is mine. My function is my best friend. It is my life. I must master it as I must master my life. My function, without me, is useless. Without my function, I am useless. I must code my function true. I must program straighter than my enemy who is trying to underbid me. I must out bid him before he under cuts me.

My function and myself know that what counts in this project is not the mods we buy, the noise of our questions, nor the errors we make. We know that it is the output that count.

My function is human, even as I, because it is my life. Thus, I will learn it as a brother. I will learn its weaknesses, its strength, its parts, its accessories, its inputs and its outputs I will ever guard it against the ravages of upgrades and piss poor coders as I will ever guard my legs, my arms, my eyes and my heart against damage. I will keep my function clean and ready. We will become part of each other.

Before PHP and MySQl, I swear this creed. My function and myself are the defenders of my web site. We are the masters of our enemy. We are the saviors of my life. So be it, until victory is Dolphin's and there is no enemy, but peace!

Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life
Quote · 30 Aug 2010

still no solution to this? animated gifs are very popular ... and i am not talking about hearts and cats but about animated avatars and short clips ... almost every forum uses it ... why cant dolphin? :-(

Quote · 1 Sep 2010

simplest way would be to resize animated gifs as well ... can't be there is no lib that cant resize all the frames and put it together again ... or bypass animated gifs and just use width/height ... or only get thumbs of pics larger than a certain x/y so small animated gifs would be shown without no problem?

 

also avatars shouldnt need to be cropped to a perfect square ... that makes no sense and ruins animated gifs as well caus of GD/imagemagick processing

Quote · 1 Sep 2010

Hey Boonex - please address this issue...
how do Facebook and MySpace handle animated gifs? And why cant Dolphin???

Quote · 3 Sep 2010

I found an animated gif for you. Enjoy

1329987aqvbw2qgl1.gif

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 3 Sep 2010

 

I found an animated gif for you. Enjoy

 

Uggg.

https://www.deanbassett.com
Quote · 3 Sep 2010

OK - first off - if you create the avatars as animated gifs, you can upload them by ftp to the modules/boonex/avatar/data/ready folder - then from here - change the extension of all the gifs to jpg - that will allow the user to select preuploaded animated avatars - such as here - http://unity-of-lords.co.cc - if you look on the bottom right there is an animated gif that has been renamed to jpg and is a default animation in the avatar list.

 

So basically - you could have your members mail you the original gifs and you can upload them as default avatars

caredesign.net
Quote · 30 Jan 2012

While I love that there is a workaround for this problem (and yes, it is a problem for social networks), but omg what a total pain in the ass!! If even a few dozen of my members want to upload .gifs and then change them out regularly (which is what they do want to do) then that's WAYYYYY more work for me and Dolphin's already a pretty damn work-intensive site to admin!!!

 

OK - first off - if you create the avatars as animated gifs, you can upload them by ftp to the modules/boonex/avatar/data/ready folder - then from here - change the extension of all the gifs to jpg - that will allow the user to select preuploaded animated avatars - such as here - http://unity-of-lords.co.cc - if you look on the bottom right there is an animated gif that has been renamed to jpg and is a default animation in the avatar list.

 

So basically - you could have your members mail you the original gifs and you can upload them as default avatars

 

Quote · 30 Jan 2012

In response to ggsinc - I agree - but you dont want to know the workaround for individual member avatars - that is even worse. But also - not knowing what age levels you are allowing on your site - I tend to like to have the control of allowing certain avatars before otrs see them. I am working on an alliance site - in which we have members that are as young as 8 years old - now do i really want them to see some of the animated avatars out there that are of sexual content? Not really - this could cause issues with parents who may see these avatars.

 

But for those who may be interested, or may be able to use the info in finding a permanent resolution - here it is:

 

When a user uploads their own profile pic, as someone said before - the system creates a thumbnail copy and converts all images to .jpg format (I will look later for the conversion code and see if there is a way to not convert gif files)

When this image is uploaded it is saved to /modules/boonex/avatar/data/images folder and renamed to a number.jpg and a second as a numberi.jpg - ex: 1.jpg and 1i.jpg

Heres the tricky part - first you have to find which avatar is the one you want to change -  so you have to download and open the mall till you find it. then once you have found the one that you want, delete both versions from the folder. make sure you have 2 copies of the original gif and that they are at 64 x 64 size.

Rename these gifs to the corresponding name of the ones that you have removed such as 1.gif and 1i.gif. Then upload to server using ftp. After they are uploaded on the server - change the file extension from gif to jpg - clear the cache_public folder and the animation will work.

 

Uncrazingly long process for something that shold be automatic - yes I know. ANd although I am just an amateur I will continue to see if I can find any easier or better solutions.

caredesign.net
Quote · 30 Jan 2012
I've uploaded animated gif's to the avatar directory & changed the extension to .jpg.. It's working beautifully. I also think being able to moderate the animated avatars available on my site is important. I had trouble resizing the images & maintaining animation, but 100x100 sized avatars looks just fine on my site. Thanks for workaround info!
Quote · 30 Jan 2012

Hi

Is anyone found a way to unable animated gif ?

in some answer it's about changing extension in ftp... but it's not a solution for users in the site.

Is there an extension of modification or something that exist ?

Some answers talks about cooliris and resizing ; is there a way to disable that ?

Regards

Quote · 17 Jul 2012

No. No solution. And it's not cooliris. Dolphin resizes images using php's built in GD library. When the resize is done, anaimations are lost. There is not current way to correct that.

The ability to allow animated gifs is scheduled for for the next release. Dolphin 7.1.0 http://www.boonex.com/trac/dolphin/ticket/2688

Thats if they do not move it to dolphin 8

https://www.deanbassett.com
Quote · 17 Jul 2012

Hi,

The function that uses GD library to re-size is in what file ?

-----

According to this link : http://blog.oskoui-oskoui.com/?p=404

it's possible..

in this link they talk about

Step 1: Extraction of the GIF’s frames

$animation ="../gif_upload/animated_image.gif"; // link to the file
$gifDecoder = new GIFDecoder ( fread ( fopen ( $animation, "rb" ), filesize ($animation) ) );
$delay = $gifDecoder->GIFGetDelays ( ); // get the delay between each frame
// treatment of the reduced images 225x127
$i = 1;
foreach ( $gifDecoder -> GIFGetFrames ( ) as $frame ) {
   fwrite ( fopen ( "resizeGif/tmp_reduced/image$i.gif" , "wb" ), $frame );  // write each frame in a temporary file
   $img = "resizeGif/tmp_reduced/image$i.gif"; // File image location
   $newfilename = "resizeGif/tmp_reduced/image$i.gif"; // New file name
   $w = 225;  // new width
   $h = 127;  // new height
   resize($img, $w, $h, $newfilename);  // function to reduce the image
 
   $i++;
}

Step 2: Reduction of the Frames

function resize($img, $w, $h, $newfilename) {
 
 //Check if GD extension is loaded
 if (!extension_loaded('gd') && !extension_loaded('gd2')) {
  trigger_error("GD is not loaded", E_USER_WARNING);
  return false;
 }
 
 //Get Image size info
 $imgInfo = getimagesize($img);
 switch ($imgInfo[2]) {
   case 1: $im = imagecreatefromgif($img); break;
   case 2: $im = imagecreatefromjpeg($img);  break;
   case 3: $im = imagecreatefrompng($img); break;
   default:  trigger_error('Unsupported filetype!', E_USER_WARNING);  break;
 }
 
 //If image dimension is smaller, do not resize
 if ($imgInfo[0] <= $w && $imgInfo[1]  $h/$imgInfo[1]) {
   $nWidth = $w;
   $nHeight = $imgInfo[1]*($w/$imgInfo[0]);
  }else{
   $nWidth = $imgInfo[0]*($h/$imgInfo[1]);
   $nHeight = $h;
  }
 }
 $nWidth = round($nWidth);
 $nHeight = round($nHeight);
 
 $newImg = imagecreatetruecolor($nWidth, $nHeight);
 
 // Check if this image is PNG or GIF, then set if Transparent
 if(($imgInfo[2] == 1) OR ($imgInfo[2]==3)){
  imagealphablending($newImg, false);
  imagesavealpha($newImg,true);
  $transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127);
  imagefilledrectangle($newImg, 0, 0, $nWidth, $nHeight, $transparent);
 }
 imagecopyresampled($newImg, $im, 0, 0, 0, 0, $nWidth, $nHeight, $imgInfo[0], $imgInfo[1]);
 
 //Generate the file, and rename it to $newfilename
 switch ($imgInfo[2]) {
  case 1: imagegif($newImg,$newfilename); break;
  case 2: imagejpeg($newImg,$newfilename);  break;
  case 3: imagepng($newImg,$newfilename); break;
  default:  trigger_error(&#039;Failed resize image!&#039;, E_USER_WARNING); break;  }
 
   return $newfilename;
}

 

Step 3: Fusion of the Frames to Create the New Resized GIF

//Build a frames array from sources
$i = 1;
if ( $dh = opendir ( "resizeGif/tmp_thumbnail/" ) ) {
 while ( false !== ( $dat = readdir ( $dh ) ) ) {
    if ( $dat != "." && $dat != ".." ) {
          $framesThumb [ ] = "resizeGif/tmp_thumbnail/image$i.gif";
          $i++;
     }
  }
  closedir ( $dh );
}
 
$gifThumb = new GIFEncoder (
        $framesThumb,
        $delay,
        0,
        2,
        0, 0, 0,
        "url"
);
 
// save the new gif file
$fpThumb = fopen('../gif_upload/thumb_image.gif', 'w');
fwrite($fpThumb, $gifThumb->GetAnimation());
fclose($fpThumb);
Quote · 21 Jul 2012

Maybe by pass the cropping function upload exact size of image after selecting it will add up to my avatar block...

"Your future is created by what you do today, not tomorrow." @ www.dexpertz.net
Quote · 4 Jan 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.