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

Keep spaces in image path #41

Closed
wants to merge 1 commit into from
Closed

Keep spaces in image path #41

wants to merge 1 commit into from

Conversation

tomblixt
Copy link

If a file name of an image has spaces, the parse function will replace the spaces with '%20'. This way the reference won't be recognized by firebase. So after the parse functions I changed it back to regular spaces.

If a file name of an image has spaces, the parse function will replace the spaces with '%20'. This way the reference won't be recognized by firebase. So after the parse functions I changed it back to regular spaces.
@mattreid1
Copy link
Owner

Thanks, I'll take a look at this soon.

@mattreid1 mattreid1 linked an issue May 1, 2021 that may be closed by this pull request
@@ -61,7 +61,7 @@ class FirebaseImage extends ImageProvider<FirebaseImage> {

static String _getImagePath(String location) {
final uri = Uri.parse(location);
return uri.path;
return uri.path.replaceAll('%20', ' ');
Copy link
Owner

Choose a reason for hiding this comment

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

In testing, I've found an issue where if the image has "%20" in the filename, it will replace that with a space as well. Any ideas?

Choose a reason for hiding this comment

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

Just an idea. It maybe not the best, but replace "%20" with something completely unique value like "|-|" or anything (which you think shouldn't be in filename or pathname) prior to parse which converts spaces to "%20". And then lastly replace back all the occurence of your uniquely added string with "%20".

This pull request was closed.
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.

path with spaces returns object-not-found
3 participants