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

Fix isImage helper function #101

Merged
merged 1 commit into from
Feb 22, 2020
Merged

Fix isImage helper function #101

merged 1 commit into from
Feb 22, 2020

Conversation

faupol3
Copy link
Contributor

@faupol3 faupol3 commented Feb 18, 2020

Better to avoid checking by extension and rely on mime types.

Better to avoid checking by extension and rely on mime types.
@faupol3 faupol3 requested a review from Yuvaleros February 18, 2020 23:26
This was referenced Feb 18, 2020
@Yuvaleros Yuvaleros merged commit 33fb658 into Yuvaleros:master Feb 22, 2020
@faupol3 faupol3 deleted the patch-1 branch April 15, 2020 14:50
@madaher-dev
Copy link

This does not work with S3 images as the url has no extension. any advise?

@madaher-dev
Copy link

This does not work with S3 images as the url has no extension. any advise?

I managed to add extension in S3 and now my initial files array looks like this. Still no preview and i still see this placeholder thumb
[
"https://poco-pccm.s3.eu-west-3.amazonaws.com/a861e279a45da1e71a893613508562ee.jpg",
"https://poco-pccm.s3.eu-west-3.amazonaws.com/f5f25c52eff290ce45c768870b9f1065.jpg"
]

@faupol3
Copy link
Contributor Author

faupol3 commented Nov 5, 2021

Hi! I haven't used this library since last year when I submitted the fix, but I'll try to help anyways.
So, since the check isn't being done based on the file extension, adding an extension won't help in any way.
Having said that, can you check the content-type of the S3 file and report back? Are you uploading it as "image/*"?

@madaher-dev
Copy link

Thank you so much
I am uploading the images to S3 using multerS3
The type in S3 says jpg
I just realized there is a contentType property in S3. I will set it as image/* and try again. Will let you know
Thx again for your help

@faupol3
Copy link
Contributor Author

faupol3 commented Nov 5, 2021

Sure np. Just make sure the type is not image/* literally but image/jpeg if that's the format.
If I have time, I'll make a PR with a better implementation that does not depend on metadata being present.
Cheers

@madaher-dev
Copy link

Same behavior if i set
contentType: multerS3.AUTO_CONTENT_TYPE,
or
contentType: 'image/jpeg'
i keep getting jpg as type in S3 and the images still appear with the default thumb

@faupol3
Copy link
Contributor Author

faupol3 commented Nov 5, 2021

You should probably follow any existing issues or create one yourself.
I added this PR that will most probably fix your issue as well
#334
Cheers

@madaher-dev
Copy link

Thanks a lot.
What do you mean by follow any existing issues of create one yourself?

@faupol3
Copy link
Contributor Author

faupol3 commented Nov 6, 2021

@madaher-dev I mean there are a couple of open issues which look very similar to yours. Check out the PR I linked above and you'll see those.
Once in there, you can subscribe to them to get notifications on any updates, same thing for the PR.
Cheers

@madaher-dev
Copy link

Cool will do
Cheers

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.

3 participants