| 45 | } |
| 46 | |
| 47 | bool BitmapSequence::isEmptyBitmapFrame(size_t frameIndex) { |
| 48 | // There was a bug in PAGExporter that causes an empty frame being exported as 1x1 frame, so we |
| 49 | // need to identify this kind of empty frame here. |
| 50 | if (frameIndex >= frames.size()) { |
| 51 | return false; |
| 52 | } |
| 53 | auto frame = frames[frameIndex]; |
| 54 | for (auto bitmap : frame->bitmaps) { |
| 55 | if (bitmap->x != 0 || bitmap->y != 0) { |
| 56 | return false; |
| 57 | } |
| 58 | if (bitmap->fileBytes->length() > 150) { |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | int width = 0; |
| 63 | int height = 0; |
| 64 | if (!WebPGetInfo(bitmap->fileBytes->data(), bitmap->fileBytes->length(), &width, &height)) { |
| 65 | LOGE("Get webP size fail."); |
| 66 | } |
| 67 | if (width > 1 || height > 1) { |
| 68 | return false; |
| 69 | } |
| 70 | } |
| 71 | return true; |
| 72 | } |
| 73 | |
| 74 | bool BitmapSequence::verify() const { |
| 75 | if (!Sequence::verify() || frames.empty()) { |
no test coverage detected