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

Error Could not find image file #72

Open
Paul12pp opened this issue Dec 13, 2023 · 4 comments
Open

Error Could not find image file #72

Paul12pp opened this issue Dec 13, 2023 · 4 comments

Comments

@Paul12pp
Copy link

Hi!
Im getting this error
Could not find image file:///Users/macbookpro/Library/Developer/CoreSimulator/Devices/15DB62A5-3463-48C7-A25F-694A5F4F1CDF/data/Containers/Data/Application/C5A58443-6533-474A-85E1-8D914F803105/Library/images_cache/da2d862b5aa3909076da5802367a62add56635bb.png

And some images are no loading.

Screenshot 2023-12-13 at 4 02 52 PM Screenshot 2023-12-13 at 4 03 13 PM

Platform: iOS

    "@georstat/react-native-image-cache": "^3.1.0",
    "react": "18.2.0",
    "react-native": "0.72.6",

my code in the app.js

CacheManager.config = {
  baseDir:
    Platform.OS === 'ios'
      ? `${Dirs.LibraryDir}/images_cache/`
      : `${Dirs.CacheDir}/images_cache/`,
  blurRadius: 15,
  cacheLimit: 0,
  maxRetries: 3,
  retryDelay: 3000,
  sourceAnimationDuration: 500,
  thumbnailAnimationDuration: 500,
  getCustomCacheKey: (source: any) => {
    let newCacheKey = source;
    if (source.includes('?')) {
      newCacheKey = source.substring(0, source.lastIndexOf('?'));
    }
    return newCacheKey;
  },
};

this is an example of an uri in my server:

https://{SOME}.amazonaws.com/{SOME}/e0f2c062-2540-47c7-92b3-0a0e210fb681.jpeg?AWSAccessKeyId=AKIAT6CYCCTUOA625D6D&Expires=1702501015&Signature=OWBrS%2Fed%2BErzk2d0DWAk8b5%2BlGE%3D

@ubaidkolad
Copy link

@Paul12pp - hey did you find a solution for this?

@Paul12pp
Copy link
Author

Paul12pp commented Feb 12, 2024

@Paul12pp - hey did you find a solution for this?

Hi, I made my own image cache component using react-native-file-access, if you wanna I can send you the source code.

@AlexanderBich
Copy link

In my case it was due to misconfiguration on the google-storage side, where if for public images authorization header was present it was sending 401

@AlexanderBich
Copy link

AlexanderBich commented Aug 7, 2024

And also the other issue is that once the error is received its response is then stored as a valid image cache file, and treated like that as well.
There's a need for a file unlinking after the error in retry function and better status checks, that includes all possible 4XX and 5XX errors

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

No branches or pull requests

3 participants