mozmorris / react-webcam

Webcam component
https://codepen.io/mozmorris/pen/JLZdoP
MIT License
1.63k stars 281 forks source link

adjust canvas dimensions according to parameters of getscreenshot function #371

Closed Psychiquest closed 1 year ago

Psychiquest commented 1 year ago

When the getScreenshot function gets called the first time, it creates a canvas object with given dimensions (if provided). From the next time onwards, it uses the same canvas to draw images. So, if someone passes different parameters the next time, it still uses the canvas built using parameters provided in the first time.

If we resize the canvas before drawing the image, it would resolve this issue.

mozmorris commented 1 year ago

Thanks @Psychiquest 👍

jpserra commented 1 year ago

Hi @mozmorris , Any plans for a new release that includes this change? It solves an issue with inconsistent screenshot dimensions I was facing. Thank you!

mozmorris commented 1 year ago

Yes, will sort today.

warrenseine commented 1 year ago

v7.1.0 (thanks!)

Psychiquest commented 1 year ago

@jpserra Did the new version fix your issue? When I pull 7.1.0 version from npm, I don't get the updated code. Is there some issue with npm registry?

Psychiquest commented 1 year ago

Hi @mozmorris https://github.com/mozmorris, can you re-publish the branch? The latest change has not been pushed in the latest version.

[image: Mailtrack] https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& Sender notified by Mailtrack https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& 06/07/23, 05:19:44 PM

On Tue, May 30, 2023 at 7:29 PM Warren Seine @.***> wrote:

v7.1.0 https://github.com/mozmorris/react-webcam/releases/tag/v7.1.0 (thanks!)

— Reply to this email directly, view it on GitHub https://github.com/mozmorris/react-webcam/pull/371#issuecomment-1568486528, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI46EPA3CL6PPO5W5LF3L3DXIX4KZANCNFSM6AAAAAAXCI3KZU . You are receiving this because you were mentioned.Message ID: @.***>

warrenseine commented 1 year ago

Wow, indeed, the 2-line change doesn't seem to be included in the bundle 😬

mozmorris commented 1 year ago

Apologies @warrenseine @Psychiquest - need to migrate the prepublish in this package.

Patch has been released at 7.1.1