|
Thank You;I want to know more
|
|
|
|
|
|
Nice, this is much appreciated!
|
|
|
|
|
|
|
Hi,
I tested your code and saw that the last two pixels of each frame are wrong.
You can see it on your example image when you zoom in.
In your case the last pixels are red.I think thats not right.
|
|
|
|
|
The bug is in class LZWEncoder, method NextPixel()...
Here is the fix:
private int NextPixel()
{
if (curPixel <= pixAry.GetUpperBound(0))
{
byte pix = pixAry[curPixel++];
return pix && 0xff;
}
else
return (EOF);
}
Variable remaining in the original code is unuseful and can be removed at all.
|
|
|
|
|
|
Is there any way to set the transperency for each frame on its own?
I tried with e.SetTransperency(Color) before adding each frame but it doesnt work ;(
|
|
|
|
|
i got this problem too…… SetTransperency only works on first frame :(
|
|
|
|
|
In AnimatedGifEncoder.cs find a method called AnalyzePixels, the usedEntry dose not been reinitialized
Change before:
protected void AnalyzePixels()
{
int len = pixels.Length;
int nPix = len / 3;
indexedPixels = new byte[nPix];
NeuQuant nq = new NeuQuant(pixels, len, sample);
colorTab = nq.Process();
int k = 0;
for (int i = 0; i < nPix; i++)
{
int index =
nq.Map(pixels[k++] & 0xff,
pixels[k++] & 0xff,
pixels[k++] & 0xff);
usedEntry[index] = true;
indexedPixels[i] = (byte)index;
}
pixels = null;
colorDepth = 8;
palSize = 7;
if (transparent != Color.Empty)
{
transIndex = FindClosest(transparent);
}
}
After change:
protected void AnalyzePixels()
{
int len = pixels.Length;
int nPix = len / 3;
indexedPixels = new byte[nPix];
NeuQuant nq = new NeuQuant(pixels, len, sample);
colorTab = nq.Process();
int k = 0;
usedEntry = new bool[256];
for (int i = 0; i < nPix; i++)
{
int index =
nq.Map(pixels[k++] & 0xff,
pixels[k++] & 0xff,
pixels[k++] & 0xff);
usedEntry[index] = true;
indexedPixels[i] = (byte)index;
}
pixels = null;
colorDepth = 8;
palSize = 7;
if (transparent != Color.Empty)
{
transIndex = FindClosest(transparent);
}
}
|
|
|
|
|
I made this change and I still get black backgrounds. Has anyone ever come up with a solution for this?
|
|
|
|
|
Software i developed with this Gif.Components.dll is deleted by security soft (Norton 2010) warning with high level risk. There was no warning with other security soft (Mcafee).
Is anyone encountered with this kind of problem with this dll?
-----------------
There is no warning with Debug file, only Release file.
Visual Studio 2008
Windows7
modified on Monday, December 20, 2010 8:45 AM
|
|
|
|
|
>Is anyone encountered with this kind of problem with this dll?
Yes, every Norton user. The solution to this is to install some normal security software, which is used by normal people, for example, Kaspersky Antivirus 2012.
|
|
|
|
|
I'm just trying to understand the LZWEncoder part of the code better... at one point there's a call to LZWEncoder:
LZWEncoder encoder = new LZWEncoder(width, height, indexedPixels, colorDepth);
But at this point, indexedPixels is only one third the size of the orginal array (Pixels), whiel width and height are their
original values. Inside LZWEncoder loops on indexedPixels width x height times... and thus should get an array out of bounds
error.... shouldn't it?
|
|
|
|
|
Hi,
I am using GifDecoder.cs and I have been hitting some issues like out of bound array exceptions. I don't want to mess up with the code if I can get the updated version of it. It would greatly help me to work on my project.
If anyone has the updated version of it please send it to muppadivya@gmail.com
Thank you,
Divya.
|
|
|
|
|
For some odd reason when I try to do this with images that have a transparent background, it makes the background color black and it makes the bottom right corner's pixel a different color for each frame.
When I try to use SetTransparency(Color) It still does the bottom right corner thing and keeps the 2nd or 3rd frame black instead of transparent.
|
|
|
|
|
The first frame of all exported gifs seems to have each pixel of one (and only one) color replaced with white.
This only happens with the first frame. Someone help, please, because this is driving me insane.
|
|
|
|
|
|
Awesome Thank you Simon !
|
|
|
|
|
Hello,
nice work on this library. One detail though; after AnimatedGifEncoder finishes i try to delete the input files however the following exception arises: "System.IO.IOException: The process cannot access the file 'C:\img.jpg.2gf.5' because it is being used by another process."
This is the code that i have added the Example.Main().
Thread t = new Thread(delegate()
{
try
{
foreach (var filePath in imageFilePaths)
{
new FileInfo(filePath).Delete();
}
}
catch (IOException ex)
{
}
});
t.Start();
It catches the exception and it is the cleanest way around i could find. I would like, however, to know if is there any other way around it, like forcing the release of the images in your src code ?
Thank you
|
|
|
|
|
I had this same problem, on two counts.
The plan was
Collect the images (in my case from videos using ffmpeg).
Create the GIF.
Remove the images because I don't need them anymore.
My first attempt I could not get AnimatedGifEncoder to let go of the image files, but also, if I went back in to recreate the GIF file after the first creation, it would not let go of that file either so that my code could replace it. That first attempt I had to use newly named gif files, then I could remove the old one once that was made.
So U moved on, I usualy do anything ffmpeg in its own thread anyway, but decided to do the same with AnimatedGifEncoder.
New plan
Run thread to collect images.
When ready Run thread to create GIF
When both are finished (and removed) I can remove the images and run another thread to replace the GIF.
I have to say that I am not yet convinced this is an AnimatedGifEncoder problem, I am getting hints now that it is something to do with C#. This problem does not occur in either java or C++.
I had to sign up, I felt a bit guilty borrowing code ideas and not giving anything back.
|
|
|
|
|
Hi gOODiDEA.NET, great work.
I've created a derived work based on Phil@ThinkEdge's amended version of this library. The main changes I've made are adding support for a single global colour table (as opposed to a local colour table for each frame) to the encoder, making use of generics in .net 2.0, and factoring out many of the building blocks of GIF files into their own separate classes with most of their attributes exposed as public properties.
I've also written two small applications which make use of this derived work, and I'd like to publish/release the lot under a free software license (ideally the GNU GPL if that's compatible with the CPOL). Would that be OK with you?
Simon.
|
|
|
|
|
Please do !!!!
We cant wait for a new version
(if you dont want to make it public yet, would you mind to send it to me, so i can try it ?)
cheers
|
|
|
|
|
I'd love to release it into the wild, I'm just slightly reluctant to do so without GoodIdea.Net's blessing. Having said that, I'm not sure he's ever going to read or reply to this thread, so where would I stand legally if I just went ahead and released it?
Most importantly, would I be in breach of the CPOL if I were to release my version under the GPL without waiting for permission? I've read the comparison of licenses page, and I still think the GPL is most appropriate for my needs - I just want to get my code out there and have other people using it, pointing out bugs etc, I have no interest in making money out of it.
I'm not sure whether my version will count as an improvement on the one posted here. Some may find it easier to understand and use, some may find it's a lot slower, some may find it doesn't support what they could do with the original version (I'm pretty sure I've broken some features of the animator although the ones I'm using seem to work just fine). But that's where I need you good folks to try it out, and to let me know where you find it isn't working for you. And that's why I need to resolve this issue over licensing so that I can publish with a clean conscience
|
|
|
|