-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(*): remove canvas dependency #50
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,7 @@ import type { | |
Frame | ||
} from '@antoinemopa/beamcoder'; | ||
import beamcoder from '@antoinemopa/beamcoder'; | ||
import type { ImageData } from 'canvas'; | ||
import { createImageData } from 'canvas'; | ||
import type { ImageData } from '../types'; | ||
import { BaseExtractor } from '../BaseExtractor'; | ||
import type { Extractor, ExtractorArgs, InterpolateMode } from '../../framefusion'; | ||
import { DownloadVideoURL } from '../DownloadVideoURL'; | ||
|
@@ -256,12 +255,12 @@ export class BeamcoderExtractor extends BaseExtractor implements Extractor { | |
return null; | ||
} | ||
const rawData = this._resizeFrameData(frame); | ||
const image = createImageData( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we will create this function in luminary instead |
||
rawData, | ||
frame.width, | ||
frame.height | ||
) as ImageData; | ||
return image; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was nice to have ImageData type, but since it comes with complex build requirements, I think it makes sense to remove 😿 |
||
|
||
return { | ||
data: rawData, | ||
width: frame.width, | ||
height: frame.height, | ||
}; | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type ImageData = { | ||
data: Uint8ClampedArray; | ||
width: number; | ||
height: number; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need canvas to run tests, I just moved it to devDeps