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

Tests don't pass on master #6

Open
kj800x opened this issue Jan 8, 2019 · 3 comments
Open

Tests don't pass on master #6

kj800x opened this issue Jan 8, 2019 · 3 comments

Comments

@kj800x
Copy link
Contributor

kj800x commented Jan 8, 2019

> thumbsupply@0.3.1 test /home/kevin/Desktop/thumbsupply
> mocha



  thumbsupply
    #generateThumbnail()
      ✓ should be creating the thumbnail (300ms)
      1) should be creating the thumbnail as specified
    #lookupThumbnail()
      ✓ should lookup and fetch the thumbnail
      ✓ should not lookup and fetch the expired thumbnail


  3 passing (711ms)
  1 failing

  1) thumbsupply
       #generateThumbnail()
         should be creating the thumbnail as specified:

      AssertionError [ERR_ASSERTION]: 136 == 135
      + expected - actual

      -136
      +135
      
      at testResolution (test/test.js:16:16)
      at thumbsupply.generateThumbnail.then.thumbnail (test/test.js:49:21)
      at process.internalTickCallback (internal/process/next_tick.js:77:7)



npm ERR! Test failed.  See above for more details.

It looks like maybe the assertion value is simply wrong?

@RyanAfrish7
Copy link
Owner

Assertion value is right. Irrespective of the requested thumbnail dimensions, I always find the actual value is offset by 1px.

@RyanAfrish7
Copy link
Owner

Interesting leads here.
fluent-ffmpeg/node-fluent-ffmpeg#910

@kj800x
Copy link
Contributor Author

kj800x commented Jul 30, 2019

Regardless of the discussion on node-fluent-ffmpeg, we should probably do something so that the tests pass. If node-fluent-ffmpeg automatically does the rounding and there's nothing we can do to change that, we should probably just document that the rounding happens and update the test to account for it.

Most users probably don't care if the generated thumb is 1px off of the requested value. Most people also probably request even resolutions or just use the default ThumbSize.MEDIUM or ThumbSize.LARGE, in which case they don't care about the exact resolution.

The only case where it could be problematic would be if someone was relying on getting an image with the exact dimensions that they requested, but since the library already will change dimensions to ensure the aspect ratio is correct, I don't think we should worry about that case.

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