animated-gif

Reading Metadata property of GifBitmapDecoder…why is it null?

随声附和 提交于 2019-12-02 07:51:14
问题 How can I read the delay, left and top offset data for each frame of a gif? I've gotten this far. Load the Gif var myGif = new GifBitmapDecoder(uri, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad); Get a frame var frame = myGif.Frames[i]; From MSDN: Native Image Format Metadata Queries read (ushort)Metadata.GetQuery("/grctlext/Delay") , (ushort)Metadata.GetQuery("/imgdesc/Left") , (ushort)Metadata.GetQuery("/imgdesc/Top") But two things don't work. First the Metadata

Reading Metadata property of GifBitmapDecoder…why is it null?

試著忘記壹切 提交于 2019-12-02 04:35:43
How can I read the delay, left and top offset data for each frame of a gif? I've gotten this far. Load the Gif var myGif = new GifBitmapDecoder(uri, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad); Get a frame var frame = myGif.Frames[i]; From MSDN: Native Image Format Metadata Queries read (ushort)Metadata.GetQuery("/grctlext/Delay") , (ushort)Metadata.GetQuery("/imgdesc/Left") , (ushort)Metadata.GetQuery("/imgdesc/Top") But two things don't work. First the Metadata property of both the gif and the frame are always null, even if I try different animated gif files. Second,

How to encode an animated GIF in Java, using ImageWriter and ImageIO?

情到浓时终转凉″ 提交于 2019-12-02 04:18:47
I've looked all over the place, but can't seem to find any easy to understand explanation. (I've found classes and methods written by other Java users that can do this, but I'm hoping to write my own.) Here is the createImage() method of GIFanim . Perhaps that will give you a start. public byte[] createImage() throws Exception { ImageWriter iw = ImageIO.getImageWritersByFormatName("gif").next(); ByteArrayOutputStream os = new ByteArrayOutputStream(); ImageOutputStream ios = ImageIO.createImageOutputStream(os); iw.setOutput(ios); iw.prepareWriteSequence(null); int i = 0; for (AnimationFrame

Is it possible to play GIF format in Android? [closed]

南楼画角 提交于 2019-12-02 02:35:14
I want to add play gif format to my android app. Could this be done, and how would I do it? Janusz It seems that playing animated GIFs is not supported directly in Android. The Google docs state the GIF is a discouraged file type for using in your Android projects. There are some possibilities but they all seem to require a great deal of work to show your animated GIFs. The one thing that seems to be working is splitting up the GIF into its frame and do the animation between the frames yourself, see this question for a little bit more information. There is also this question that shows another

Load and display multiple animated gifs at the same time (synchronised) with Javascript

爷,独闯天下 提交于 2019-12-02 02:18:23
问题 I'm by no means any kind of coder or programmer, but I've been trying to load and display some gifs so that they all animate from the beginning at the same time. In other words, I need them to be synchronised. I've done a lot of Googling and what I've come up with seems to work with Chrome/Safari and Firefox, but as usual, Internet Explorer refuses to cooperate. My current code is this: var images = ["thephoto1", "thephoto2", "thephoto3", "thephoto4", "thephoto5"]; function initImages() { for

Loading spinner gif image gets stuck

我的未来我决定 提交于 2019-12-02 02:02:09
I have a 6kb animated gif loading spinner. when I open it in a browser window, it spins fine. But when it opens on an ajax call on my web page, it is stuck. It appears ontime and disappears ontime, but does not spin. Any ideas? Here is the jQuery code: $('#please-wait') .css("visibility", "visible")//.hide() .ajaxStart(function() { $(this).css("visibility", "visible"); }) .ajaxStop(function() { $(this).css("visibility", "hidden"); }); or $('#please-wait') .show() .ajaxStart(function() { $(this).show(); }) .ajaxStop(function() { $(this).hide(); }); any ideas? Here is a jsfiddle example of how

How to avoid malloc while using CGImageDestinationFinalize

ぐ巨炮叔叔 提交于 2019-12-02 01:47:42
I am trying to programmatically create GIF in iOS, using the following stack's question: Create and and export an animated gif via iOS? My code looks like this: // File Parameters const void *keys[] = { kCGImagePropertyGIFLoopCount }; const void *values[] = { (CFNumberRef) 0 }; CFDictionaryRef params = CFDictionaryCreate(NULL, keys, values, 1, NULL, NULL); const void *keys2[] = { kCGImagePropertyGIFDictionary }; const void *values2[] = { (CFDictionaryRef) params }; CFDictionaryRef fileProperties = CFDictionaryCreate(NULL, keys2 , values2, 1, NULL, NULL); // URL to the documents directory NSURL

Determine GIF Animation Status?

為{幸葍}努か 提交于 2019-12-01 23:56:56
问题 Is there any way to detect via javascript whether a GIF image's animation is completed or not? 回答1: No, it is not. Javascript cannot manipulate GIF directly. But maybe jsgif can help you 回答2: By now it's possible. There are packages available to extract information from byte buffer. Like gif-info. Combining that with HTMLImage.onload it's possible to start timeout exactly with delay when animation should already ended. Or having duration value we can set up CSS animation on target image that

How can I export CSS animation as animated PNG, gif, or WEBP *with transparency*?

别等时光非礼了梦想. 提交于 2019-12-01 22:48:58
Press "Run code snippet" below to see the animated loading spinner that I want to save. I want to replace all green colors with transparency. Also, I'd like the animation to loop perfectly. I tried recording a screen capture video using OBS and then uploading to https://ezgif.com/video-to-gif and using the "Replace color with transparency" feature, but it didn't remove any green color at all. Also, if exporting canvas animations is easier than capturing CSS animations, I'd accept an answer that shows me how. body { display: flex; overflow: hidden; height: 100vf; padding: 0; margin: 0;

Resizing GIFs with Wand + ImageMagick

試著忘記壹切 提交于 2019-12-01 20:19:26
I am using Wand 0.3.7 with ImageMagick 6.8.8-10 to batch-resize some animated GIF files I have. But for some reason, Wand only resizes one frame in the image, leaving the others at their original size. Here is the original image I am trying to resize: And here is the output from Wand: If I use ImageMagick from the command line directly (following instructions from here ), the GIF is correctly resized, as expected: This is how I am currently resizing the image: with Image(filename="src.gif") as img: img.resize(50, 50) img.save("dest.gif") I have also tried iterating through each frame and