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

Make handlers return buffers #394

Merged
merged 3 commits into from Jul 4, 2018
Merged

Conversation

eduardoboucas
Copy link
Contributor

@eduardoboucas eduardoboucas commented Jun 29, 2018

This PR changes the various handlers so that they return a buffer instead of a stream. This avoids multiple conversions between buffers and streams throughout the lifecycle of a request. What handlers return is ready to be sent in the response.

As part of this change, we removed reliance on image-size-stream to calculate the natural image dimensions, as well as the old method for obtaining EXIF data. We now use sharp for all of this, which should represent a performance improvement.

To do before merging:

  • Ensure exif data is being added to the response
  • Add unit tests for exif data

Closes #390 and #393.

@coveralls
Copy link

coveralls commented Jun 29, 2018

Pull Request Test Coverage Report for Build 1221

  • 108 of 121 (89.26%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.006%) to 88.101%

Changes Missing Coverage Covered Lines Changed/Added Lines %
dadi/lib/controller/index.js 14 20 70.0%
dadi/lib/handlers/image.js 58 65 89.23%
Totals Coverage Status
Change from base Build 1215: -0.006%
Covered Lines: 1640
Relevant Lines: 1797

💛 - Coveralls

@eduardoboucas eduardoboucas merged commit 3f94ee4 into develop Jul 4, 2018
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.

None yet

2 participants