Added some format checks

This commit is contained in:
Ilya Laktyushin 2019-07-07 17:01:38 +02:00
parent 529dfcd10a
commit 1aa9c3d871

View File

@ -20,6 +20,17 @@
_frameCount = (int32_t)_animation->totalFrame();
_frameRate = (int32_t)_animation->frameRate();
size_t width = 0;
size_t height = 0;
_animation->size(width, height);
if (width != height || (width != 100 && width != 512)) {
return nil;
}
if ((_frameRate > 30 && _frameRate != 60) || _animation->duration() > 4.5) {
return nil;
}
}
return self;
}