-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save Gif from Gif source #8
Comments
Hi Dunge, I am not actively maintaining this project. If you find a solution please feel free to submit a pull request for the change. I will leave these issues open for others to address. |
Although this issue is old, it is not an issue. This is due to the format animated gif (and gifs in general). A work around is to save it to a memory stream as any other format (png will retain the image's transparency/pallet info), and then reload it back into an image and pass it to the encoder. using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
// convert the source image format and save it to memory.
sourceImage.Save(ms, ImageFormat.Png);
ms.Seek(0, SeekOrigin);
// create a new image from the memory stream
sourceImage = Image.FromStream(ms);
// now we can pass sourceImage into the GifEncoder...
myGifEncoder.AddFrame(sourceimage);
} |
@RyanThiele would you be willing to make a pull request for this? |
The demo use a static image, create multiple frame by rotation and save a gif. But if the original Image loaded is a Gif, it seems to create a corrupted file.
See this code:
If I pass a Image loaded from a gif, it create a corrupted. If I comment the first two lines for the timing and the loop for the frame and pass a Image loaded from a jpeg, it create a working gif.
The text was updated successfully, but these errors were encountered: