Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix preloading does not callback when something goes wrong #22

Merged

Conversation

holycanvas
Copy link
Contributor

@holycanvas holycanvas commented Oct 31, 2019

修复加载图片失败后不回调
cocos/cocos-engine#5645

@holycanvas holycanvas requested a review from PPpro Oct 31, 2019
gif : downloadImage,
ico : downloadImage,
tiff : downloadImage,
webp : downloadImage,
Copy link
Collaborator

@PPpro PPpro Nov 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function downloadWebp (item, callback) {
    if (!cc.sys.capabilities.webp) {
        callback(new Error(cc.debug.getError(4929, item.url)));
        return;
    }
   downloadImage(item, callback);
}

这里请用 downloadWebp handler

Copy link
Contributor Author

@holycanvas holycanvas Nov 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用了,我之前的有个pr,把webp的检测放到了texture里面去了,参考:cocos-creator-packages/weapp-adapter#120

PPpro
PPpro approved these changes Nov 1, 2019
@PPpro PPpro merged commit 35cc9e1 into cocos-creator-packages:v2.2.1-release Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants