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

Tiny bug: Posts.uploads.associate #7960

Closed
PostMidnight opened this issue Oct 10, 2019 · 1 comment
Closed

Tiny bug: Posts.uploads.associate #7960

PostMidnight opened this issue Oct 10, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@PostMidnight
Copy link

It seems Posts.uploads.associate is calling image.size on all file types.
Since no width / height are available, an error log is printed.
Perhaps in image.size you can do something like:

const mimeType = mime.getType(path);
		const isImage = (/^image\//.test(mimeType));
		if(!isImage)
                      return { width: 0, height: 0 }

0,0 indicating an invalid image.
JJ.

@barisusakli barisusakli self-assigned this Oct 10, 2019
@barisusakli barisusakli added this to the 1.13.0 milestone Oct 10, 2019
@barisusakli
Copy link
Member

f272daa

tigefa4u pushed a commit to tigefa4u/NodeBB that referenced this issue Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants