Comments (16)
when I use SDWebImageHEIFCoder decode it, it can not play with animation, the images is nil.
Can you try to use the SDAnimatedImage(data: heicsData)
?
Then check the animatedImage's animationFrameCount
?
from sdwebimageheifcoder.
The HEIFCoder Demo contains a animated HEICS demo, you can have a try and change that into your heics file as well.
url: http://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic
I guess this is some decoding related issue (means, libheif
is for blame), not something code logic error.
from sdwebimageheifcoder.
If you can, upload your heics image, and I can ask for libheif's author for help
And, you can also open your heics in Safari
on Mac, can Safari show animation ? If not, I guess this maybe the issues in your image file itself, not the coder ?
from sdwebimageheifcoder.
Thank you for your help.
My heic can not play animated in Safari on My Mac. I had created it by ImageMagick, Maybe it has some errors.
I download this heic image http://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic . It also can not be played with the code.
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"starfield_animation" ofType:@"heic"];
NSData *imageData = [NSData dataWithContentsOfFile:imagePath];
UIImage *image = [UIImage sd_imageWithData:imageData]; // image.images = nil
UIImageView *imageView = ...;
imageView.image = image;
SDAnimatedImage *image = [[SDAnimatedImage alloc] initWithData:imageData]; // use this code, image=nil
There is my test heic image's url:
https://github.com/tangxc/resources_repo/blob/main/ll_interaction_heifenc.heic
https://github.com/tangxc/resources_repo/blob/main/ll_interaction_heic.heic
Thanks.
from sdwebimageheifcoder.
How did you store the image file into NSBundle ? Please pay attention now to add that into Assets Catalog
(Means, the Assets.car
)
Or can you directlly using NSURLSession to download data and do the same testing ?
from sdwebimageheifcoder.
Because as my local machine, I can see the animation in HEIFCoder' demo here.
from sdwebimageheifcoder.
I just dragged it into my project. You mean I need add it into Assets Catalog. I did it as the picture below, load image is nil:
from sdwebimageheifcoder.
Because as my local machine, I can see the animation in HEIFCoder' demo here.
Are you use my heic image?
from sdwebimageheifcoder.
I had run SDWebImageHEIFCoder Example already. The animated HEIC URL still play without animation http://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic. I don't know what's wrong with it. My test machine is iPhone 12 ProMax, iOS 15.2.
from sdwebimageheifcoder.
Found my comments years ago...Seems libheif does not support HEICs animation ?😂
But Apple's ImageIO supports this. You can test the same image using the SDWebImage demo, or change code in AppDelegate.m
// changes these 2 lines into this, which use Apple's ImageIO (close-sourced, OS vendored)
SDImageHEICCoder *AppleHEICoder = [SDImageHEICCoder sharedCoder];
[[SDImageCodersManager sharedManager] addCoder:AppleHEICoder];
from sdwebimageheifcoder.
@tangxc See:
strukturag/libheif#949
strukturag/libheif#377
from sdwebimageheifcoder.
Maybe I can have a test again using the API from libheif like heif_context_get_number_of_top_level_images
with your image sample, tomorrow
But I remember 3 years ago, this API for that Nokia animated HEIC ( http://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic) always return 1....
😣And there are no any animated
, loopcount
, or other related words in header heif.h
. I think, they don't support animation at all.
Yes, even for this starfield_animation.heic
, libheif still report only 1 primary image...And no other API about the frame count information:
Test on the libheif 1.16.2 (latest actually....) with de265 codec.
from sdwebimageheifcoder.
See: https://www.dirk-farin.net/software/libheif/index.html
libheif decodes and generates all conformant still-image HEIF/AVIF files, including HDR, and uses the color transformation matrices specified in the color profile. The HEIF decoder makes use of libde265. For encoding, x265 is used. AVIF uses either libaom or dav1d for decoding and libaom or rav1e for encoding.
Only Still Image
(static), no Image Sequence
(animated)
from sdwebimageheifcoder.
Found my comments years ago...Seems libheif does not support HEICs animation ?😂
But Apple's ImageIO supports this. You can test the same image using the SDWebImage demo, or change code in
AppDelegate.m
// changes these 2 lines into this, which use Apple's ImageIO (close-sourced, OS vendored) SDImageHEICCoder *AppleHEICoder = [SDImageHEICCoder sharedCoder]; [[SDImageCodersManager sharedManager] addCoder:AppleHEICoder];
Thank you very much.
I have tried SDImageHEICCoder and found it works, my heic image and the starfield_animation.heic all can play with animation. And the SDImageHEICCoder's API is available with ios 13.0.
from sdwebimageheifcoder.
SDImageHEICCoder's
is just wrapper for Apple's ImageIO system framework. And it ship with iOS 13+/macOS 11
I didn't find anything in open-source community about the HEIC sequence support. Even Chrome on Mac itself use Apple's ImageIO 😂 (And old version like macOS 10.15 does not support HEIC)
from sdwebimageheifcoder.
�Maybe it was truth. Thanks again.
from sdwebimageheifcoder.
Related Issues (11)
- Podspec not linting HOT 5
- Example Not Work HOT 4
- It's too slow HOT 5
- This library does not support bitcode HOT 4
- 转换出来后图片很大怎么解决
- Metadata is lost after conversion HOT 8
- Build error due to Legacy Build System HOT 5
- 在 M1 电脑上 "aom/aom_integer.h" 找不到 HOT 3
- Crash on .heic format images HOT 5
- Support for AVIF(AV1 codec for HEIF container) image format HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdwebimageheifcoder.