We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently when creating a new Image the 2 first arguments are width and height.
Would it make sense to have rather width and height as mandatory parameter of the 'options' and have only one arguments ?
This would allow to simplify the 'decode' code like in:
https://github.com/image-js/image-js-typescript/blob/main/src/load/decodeJpeg.ts#LL17C1-L20C6
But also allow the following code (useful when sending an image to a webworker):
const rawImage = image.getRawImage(); const image2 = new Image(rawImage);
@targos WDTY
The text was updated successfully, but these errors were encountered:
SGTM.
Be careful with new Image(rawImage). It will only work with 8-bit RGBA images.
new Image(rawImage)
Sorry, something went wrong.
Is there a specific reason that we didn't return the image kind in getRawImage ?
image-js-typescript/src/Image.ts
Lines 466 to 472 in d3f0d99
The idea was actually also to return the kind so that we can always use new Image(rawImage)
There is no idea in this function. It's there as a workaround for some algorithms and shouldn't be used from other projects.
No branches or pull requests
Currently when creating a new Image the 2 first arguments are width and height.
Would it make sense to have rather width and height as mandatory parameter of the 'options' and have only one arguments ?
This would allow to simplify the 'decode' code like in:
https://github.com/image-js/image-js-typescript/blob/main/src/load/decodeJpeg.ts#LL17C1-L20C6
But also allow the following code (useful when sending an image to a webworker):
@targos WDTY
The text was updated successfully, but these errors were encountered: