|
@@ -60,8 +60,8 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
|
@@ -60,8 +60,8 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
60
|
|
60
|
|
61
|
#if SD_UIKIT || SD_WATCH
|
61
|
#if SD_UIKIT || SD_WATCH
|
62
|
int loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
|
62
|
int loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
|
63
|
-#endif
|
|
|
64
|
int frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
|
63
|
int frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
|
|
|
64
|
+#endif
|
65
|
int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
|
65
|
int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
|
66
|
int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
|
66
|
int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
|
67
|
CGBitmapInfo bitmapInfo;
|
67
|
CGBitmapInfo bitmapInfo;
|
|
@@ -78,8 +78,10 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
|
@@ -78,8 +78,10 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
78
|
}
|
78
|
}
|
79
|
|
79
|
|
80
|
NSMutableArray<UIImage *> *images = [NSMutableArray array];
|
80
|
NSMutableArray<UIImage *> *images = [NSMutableArray array];
|
|
|
81
|
+#if SD_UIKIT || SD_WATCH
|
81
|
NSTimeInterval totalDuration = 0;
|
82
|
NSTimeInterval totalDuration = 0;
|
82
|
int durations[frameCount];
|
83
|
int durations[frameCount];
|
|
|
84
|
+#endif
|
83
|
|
85
|
|
84
|
do {
|
86
|
do {
|
85
|
UIImage *image;
|
87
|
UIImage *image;
|
|
@@ -97,7 +99,7 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
|
@@ -97,7 +99,7 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
97
|
|
99
|
|
98
|
#if SD_MAC
|
100
|
#if SD_MAC
|
99
|
break;
|
101
|
break;
|
100
|
-#endif
|
102
|
+#else
|
101
|
|
103
|
|
102
|
int duration = iter.duration;
|
104
|
int duration = iter.duration;
|
103
|
if (duration <= 10) {
|
105
|
if (duration <= 10) {
|
|
@@ -108,7 +110,7 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
|
@@ -108,7 +110,7 @@ static void FreeImageData(void *info, const void *data, size_t size) { |
108
|
totalDuration += duration;
|
110
|
totalDuration += duration;
|
109
|
size_t count = images.count;
|
111
|
size_t count = images.count;
|
110
|
durations[count - 1] = duration;
|
112
|
durations[count - 1] = duration;
|
111
|
-
|
113
|
+#endif
|
112
|
} while (WebPDemuxNextFrame(&iter));
|
114
|
} while (WebPDemuxNextFrame(&iter));
|
113
|
|
115
|
|
114
|
WebPDemuxReleaseIterator(&iter);
|
116
|
WebPDemuxReleaseIterator(&iter);
|