owenlongbo/McImage

大图已加忽略,依然提醒

Closed this issue · 2 comments

已给您发邮件

代码中已经添加
McImageConfig {
isCheckSize true //是否检测图片大小,默认为true
optimizeType "Compress" //优化类型,可选"ConvertWebp","Compress",转换为webp或原图压缩,默认Compress,使用ConvertWep需要min sdk >= 18.但是压缩效果更好
maxSize 110241024 //大图片阈值,default 1MB
enableWhenDebug false //debug下是否可用,default true
isCheckPixels true // 是否检测大像素图片,default true
maxWidth 1000 //default 1000 如果开启图片宽高检查,默认的最大宽度
maxHeight 1000 //default 1000 如果开启图片宽高检查,默认的最大高度
whiteList = [ //默认为空,如果添加,对图片不进行任何处理
"icon_launcher.png"
]
mctoolsDir "$rootDir"
isSupportAlphaWebp false //是否支持带有透明度的webp,default false,带有透明图的图片会进行压缩
multiThread true //是否开启多线程处理图片,default true
bigImageWhiteList = [
"lib_guide_1.png",
"lib_guide_2.png",
"lib_guide_3.png",
"lib_splash.png"
] //默认为空,如果添加,大图检测将跳过这些图片
}

依然提醒

  • What went wrong:
    Execution failed for task ':app:McImageRelease'.

You have big Imgages with big size or large pixels,please confirm whether they are necessary or whether they can to be compressed. If so, you can config them into bigImageWhiteList to fix this Exception!!!
C:\Users\86189\AndroidStudioProjects\Car99\library\build\intermediates\packaged_res\release\mipmap-xhdpi-v4\lib_guide_1.png
C:\Users\86189\AndroidStudioProjects\Car99\library\build\intermediates\packaged_res\release\mipmap-xhdpi-v4\lib_guide_2.png
C:\Users\86189\AndroidStudioProjects\Car99\library\build\intermediates\packaged_res\release\mipmap-xhdpi-v4\lib_guide_3.png
C:\Users\86189\AndroidStudioProjects\Car99\library\build\intermediates\packaged_res\release\mipmap-xhdpi-v4\lib_splash.png

大图分两种,请分别添加whiteList 和 bigImageWhiteList, 两者有区别,
大图分 size 大,也就是几m,还有一种是 宽高大,就是 1080*1080这种,这些图片都不应该出现,所以你这个图片应该是分别命中了两个case,值添加了一个