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

[BUG] name of resized image is missing original image name if there was no file type extension #20

Closed
emrebicer opened this issue Oct 1, 2019 · 7 comments
Assignees
Labels
blocked Blocked by an outstanding issue or PR type: bug Something isn't working

Comments

@emrebicer
Copy link

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your configuration

  • Extension name: _ (storage-resize-images)
  • Configuration values (redact info where appropriate):
    -Size:64x64
    -Cloud Storage Path: empty

[REQUIRED] Step 3: Describe the problem

I just added storage-resize-images extension to my firebase project, it is working as expected when i upload an image manually from the firebase console, but the problem is that whenever i use

storageRef.putString()

function to upload base64 url encoded image to the firebase storage cloud, the compressed image will be created but its name is only _64x64 (not original_64x64).

Obviously i am resizing images as 64x64.

Since the created file doesn't contain a unique name it is unaccessible for me dynamically...Is there something am i missing?

Steps to reproduce:

Install storage-resize-images extension to my firebase project.(web)

Expected result

storage-resize-images extension to create an image file using the "original.jpeg" image as "original_64x64.jpeg"

Actual result

The extension generated the image as expected but the naming was wrong, it is _64x64.jpeg instead of original_64x64.jpeg

@Salakar Salakar added the type: bug Something isn't working label Oct 1, 2019
@Salakar
Copy link
Member

Salakar commented Oct 1, 2019

Hey @emrebicer 👋 - thanks for reporting this issue, will get this looked at.

@Salakar Salakar changed the title original name is not displayed at the new compressed image [BUG] original name is not displayed at the new compressed image Oct 1, 2019
@Salakar Salakar self-assigned this Oct 1, 2019
@TheBestMoshe
Copy link

It seems like this bug only happens when the uploaded file doesn't have a file extension. When there is an extension (.jpg), or even a . at the end of the filename (random-filename.) then it works as expected. The resized image name is {original filename}_64x64.. It seems like the extension is expected and without it, something is getting messed up.

@Salakar
Copy link
Member

Salakar commented Nov 5, 2019

You can set a file extension when using putString by specifying a the file name when creating a storage reference:

const imageStorageRef = firebase.storage().ref('images/space.jpg');
// ...
imageStorageRef.putString(/* ... */) // ..

Is there some other case where it would never set a file extension?

@emrebicer
Copy link
Author

emrebicer commented Nov 5, 2019

You can set a file extension when using putString by specifying a the file name when creating a storage reference:

const imageStorageRef = firebase.storage().ref('images/space.jpg');
// ...
imageStorageRef.putString(/* ... */) // ..

Is there some other case where it would never set a file extension?

After adding ".jpg" at the end of my file names the problem went away. It looks like a proper solution for me. Closing the issue, thank you :).

@christophe-g
Copy link

Still experiencing this when an uploaded file does not have an extension.

I am aware that I can check whether filename has an extension before uploading, but IMO the resize image extension should be able to handle case without file extension.

Can this be re-opened ?

image

@laurenzlong laurenzlong reopened this Dec 17, 2019
@laurenzlong
Copy link
Contributor

@Salakar We should support file names without file type extensions. Can you work on a PR to fix this?

@laurenzlong laurenzlong changed the title [BUG] original name is not displayed at the new compressed image [BUG] name of resized image is missing original image name if there was no file type extension Dec 17, 2019
@laurenzlong
Copy link
Contributor

Actually I see it's fixed in #134 :)

@Ehesp Ehesp added the blocked Blocked by an outstanding issue or PR label Dec 31, 2019
@Ehesp Ehesp closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by an outstanding issue or PR type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants