Skip to content

[Android] Some image files are not loadable by Image component #20420

Closed
@kriskate

Description

@kriskate

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
      Memory: 1.94 GB / 8.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.6.0 - /usr/local/bin/node
      npm: 6.1.0 - /usr/local/bin/npm
      Watchman: 4.6.0 - /usr/local/bin/watchman
    SDKs:
      Android SDK:
        Build Tools: 23.0.1, 25.0.0, 25.0.2, 26.0.1, 26.0.3, 28.0.0
        API Levels: 23, 25, 26
    IDEs:
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1
      react-native: 0.56.0 => 0.56.0
    npmGlobalPackages:
      react-native-cli: 2.0.1

Tested on

  • react-native 0.56 on emulator Android 7.1.1
  • Galaxy S8 Android 8.0.0

Description

Some images won't load in component Image.

I've tried the following:

  1. prefetch() the image (btw this should probably throw an error if failed)
  2. download locally and use as native module - throws exception "Cannot find module - no such file"

The only difference I found between a loadable image and a not-loadable one is their Color profile and Alpha channel definitions:

// not loadable: 
Color profile: -
Alpha channel: no

// loadable:
Color profile: sRGB IEC61966-2.1
Alpha channel: Yes

screen shot 2018-07-26 at 23 24 12

Reproducible Demo

Here is a snack

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions