You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val options = requestService.options(request, size)
private fun ImageRequest.resolveExtras(size: Size): Extras {
var bitmapConfig = bitmapConfig //RGB_565
var allowRgb565 = allowRgb565
// Fall back to ARGB_8888 if the requested bitmap config does not pass the checks.
if (!isBitmapConfigValidMainThread(this, size)) {
bitmapConfig = Bitmap.Config.ARGB_8888
}
// Disable allowRgb565 if there are transformations or the requested config is ALPHA_8.
// ALPHA_8 is a mask config where each pixel is 1 byte so it wouldn't make sense to use
// RGB_565 as an optimization in that case.
allowRgb565 = allowRgb565 &&
transformations.isEmpty() &&
bitmapConfig != Bitmap.Config.ALPHA_8
var builder: Extras.Builder? = null
if (bitmapConfig != this.bitmapConfig) { // **not reset**
builder = extras.newBuilder().set(Extras.Key.bitmapConfig, bitmapConfig)
}
if (allowRgb565 != this.allowRgb565) {
builder = (builder ?: extras.newBuilder()).set(Extras.Key.allowRgb565, allowRgb565)
}
return builder?.build() ?: extras
}
val options = requestService.options(request, size)
there are return request.extras, options.extras is empty, request.defaults.extras have init config value
so new decode read options bitmap config is DEFAULT_BITMAP_CONFIG
BitmapFactoryDecoder
private fun BitmapFactory.Options.configureConfig(exifData: ExifData) {
var config = options.bitmapConfig
// Disable hardware bitmaps if we need to perform EXIF transformations.
if (exifData.isFlipped || exifData.isRotated) {
config = config.toSoftware()
}
// Decode the image as RGB_565 as an optimization if allowed.
if (options.allowRgb565 && config == Bitmap.Config.ARGB_8888 && outMimeType == MIME_TYPE_JPEG) {
config = Bitmap.Config.RGB_565
}
// High color depth images must be decoded as either RGBA_F16 or HARDWARE.
if (SDK_INT >= 26 && outConfig == Bitmap.Config.RGBA_F16 && config != Bitmap.Config.HARDWARE) {
config = Bitmap.Config.RGBA_F16
}
inPreferredConfig = config
}
The text was updated successfully, but these errors were encountered:
Caij
changed the title
Coil3 reset bitmap config not work
Coil3 ImageLoader set bitmap config not work
Apr 29, 2024
version:3.0.0-alpha6
init
EngineInterceptor
val options = requestService.options(request, size)
there are return request.extras, options.extras is empty, request.defaults.extras have init config value
so new decode read options bitmap config is DEFAULT_BITMAP_CONFIG
BitmapFactoryDecoder
The text was updated successfully, but these errors were encountered: