File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -702,16 +702,13 @@ async function setupIpcHandlers(logger: Logger<ILogObj>): Promise<void> {
702702 }
703703 )
704704
705- ipcMain . on (
706- 'electron:save-frame' ,
707- ( _event , payload : SaveFramePayload ) : void => {
708- if ( ! frameExportSession . outputDir ) {
709- throw new Error ( 'Frame export session has not been started.' )
710- }
711-
712- frameExportSession . frameBuffers . push ( toFrameBuffer ( payload . buffer ) )
705+ ipcMain . on ( 'electron:save-frame' , ( _event , payload : SaveFramePayload ) : void => {
706+ if ( ! frameExportSession . outputDir ) {
707+ throw new Error ( 'Frame export session has not been started.' )
713708 }
714- )
709+
710+ frameExportSession . frameBuffers . push ( toFrameBuffer ( payload . buffer ) )
711+ } )
715712
716713 ipcMain . handle (
717714 'electron:finish-frame-export' ,
Original file line number Diff line number Diff line change @@ -724,17 +724,21 @@ export class App {
724724 const snapshotCanvas = this . pixiApplication . renderer . extract . canvas ( ) as HTMLCanvasElement
725725
726726 const encodingPromise = new Promise < void > ( ( resolve , reject ) => {
727- snapshotCanvas . toBlob ( ( blob ) => {
728- if ( ! blob ) {
729- reject ( new Error ( 'Failed to encode frame.' ) )
730- return
731- }
727+ snapshotCanvas . toBlob (
728+ ( blob ) => {
729+ if ( ! blob ) {
730+ reject ( new Error ( 'Failed to encode frame.' ) )
731+ return
732+ }
732733
733- blob . arrayBuffer ( ) . then ( ( buffer ) => {
734- window . electron . ipcRenderer . send ( 'electron:save-frame' , { index, buffer } )
735- resolve ( )
736- } , reject )
737- } , 'image/jpeg' , 0.95 )
734+ blob . arrayBuffer ( ) . then ( ( buffer ) => {
735+ window . electron . ipcRenderer . send ( 'electron:save-frame' , { index, buffer } )
736+ resolve ( )
737+ } , reject )
738+ } ,
739+ 'image/jpeg' ,
740+ 0.95
741+ )
738742 } )
739743
740744 this . encodingQueue . push ( encodingPromise )
You can’t perform that action at this time.
0 commit comments