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

Resize Images: Missing original filename when uploaded file doesn't include a file extension #78

Closed
TheBestMoshe opened this issue Oct 30, 2019 · 3 comments

Comments

@TheBestMoshe
Copy link

  • Extension name: storage-resize-images
  • Configuration values (redact info where appropriate):
    Resize Image, default settings
    set Bucket to name of any other bucket that is not your default
    Deployment location Description
    us-central1
    Cloud Storage bucket for images Description
    [bucket-name]
    Sizes of resized images Description
    200x200
    Cloud Storage path for resized images (Optional) Description
    Parameter not set
    Cache-Control header for resized images (Optional) Description
    Parameter not set

Describe the problem

When an image is uploaded to the storage bucket using the Firestore Javascript client library (I didn't test it with other libraries), if the image doesn't have an extension (e.g .jpg) in its filename, the name of the resized image is just "_200x200". It is missing the actual original filename. If multiple images are uploaded, each resized image overwrites the previous one because they all have the exact same "_200x200" as the filename.

Steps to reproduce:

1 - Setup Resize Images Firebase Extension using standard config settings.
2 - Use the Firebase Javascript library to upload an image with a filename that does not contain an extension (e.g. "uploaded_file") to the Firebase storage bucket.

Expected result

The filename of the resized image should contain the original filename with the size appended to the name.

Actual result

The filename of the resized image is just the file size without the original filename

@TheBestMoshe
Copy link
Author

As a temporary workaround, I'm able to get the proper results by just adding a "." to the end of the file name.

This causes the filename to be "{original filename}_{new image size}." (notice the "." at the end).

@TheBestMoshe
Copy link
Author

I just noticed that this is a duplicate of #20

@imronpuji
Copy link

its not work for me

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

2 participants