-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Two workers & worker termination #198
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
421fc3d
Refactoring codecs
jakearchibald 88265a9
Plugging in new processor
jakearchibald 52c81b4
Fixing decorator
jakearchibald 8b0c4b9
MozJPEG free issue
jakearchibald 8d1f132
Better worker aborting, and terminate workers that aren't used for 10…
jakearchibald a14aa35
Better comment
jakearchibald 4df06a2
Ooops, half-typed comment
jakearchibald aebd42b
Uncommenting problematic line
jakearchibald cf3ed36
Surma fixed it!
jakearchibald a25fb36
Abstracting WASM initialisation
jakearchibald 12a4d12
Better comment
jakearchibald f6af028
Don't need this.
jakearchibald 6e1e4aa
Adding ticket
jakearchibald 7ac14b1
noInitalRun
jakearchibald a712617
Reverting MozJPEG issue demo
jakearchibald a83ecca
Making a const for worker timeout
jakearchibald c3aab4b
Inline docs
jakearchibald a9b8cfc
Bail early rather than nesting
jakearchibald ca97fde
Addressing nits
jakearchibald File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions { } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-bmp'; | ||
export const label = 'Browser BMP'; | ||
export const mimeType = 'image/bmp'; | ||
export const extension = 'bmp'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import { mimeType } from './encoder-meta'; | ||
import { canvasEncode } from '../../lib/util'; | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions { } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-bmp'; | ||
export const label = 'Browser BMP'; | ||
export const mimeType = 'image/bmp'; | ||
export const extension = 'bmp'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); | ||
|
||
export function encode(data: ImageData, options: EncodeOptions) { | ||
export function encode(data: ImageData) { | ||
return canvasEncode(data, mimeType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions {} | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-gif'; | ||
export const label = 'Browser GIF'; | ||
export const mimeType = 'image/gif'; | ||
export const extension = 'gif'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import { mimeType } from './encoder-meta'; | ||
import { canvasEncode } from '../../lib/util'; | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions {} | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-gif'; | ||
export const label = 'Browser GIF'; | ||
export const mimeType = 'image/gif'; | ||
export const extension = 'gif'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); | ||
|
||
export function encode(data: ImageData, options: EncodeOptions) { | ||
export function encode(data: ImageData) { | ||
return canvasEncode(data, mimeType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions { } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-jp2'; | ||
export const label = 'Browser JPEG 2000'; | ||
export const mimeType = 'image/jp2'; | ||
export const extension = 'jp2'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import { mimeType } from './encoder-meta'; | ||
import { canvasEncode } from '../../lib/util'; | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions { } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-jp2'; | ||
export const label = 'Browser JPEG 2000'; | ||
export const mimeType = 'image/jp2'; | ||
export const extension = 'jp2'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); | ||
|
||
export function encode(data: ImageData, options: EncodeOptions) { | ||
export function encode(data: ImageData) { | ||
return canvasEncode(data, mimeType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface EncodeOptions { quality: number; } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-jpeg'; | ||
export const label = 'Browser JPEG'; | ||
export const mimeType = 'image/jpeg'; | ||
export const extension = 'jpg'; | ||
export const defaultOptions: EncodeOptions = { quality: 0.5 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,6 @@ | ||
import { EncodeOptions, mimeType } from './encoder-meta'; | ||
import { canvasEncode } from '../../lib/util'; | ||
|
||
export interface EncodeOptions { quality: number; } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-jpeg'; | ||
export const label = 'Browser JPEG'; | ||
export const mimeType = 'image/jpeg'; | ||
export const extension = 'jpg'; | ||
export const defaultOptions: EncodeOptions = { quality: 0.5 }; | ||
|
||
export function encode(data: ImageData, { quality }: EncodeOptions) { | ||
return canvasEncode(data, mimeType, quality); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions { } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-pdf'; | ||
export const label = 'Browser PDF'; | ||
export const mimeType = 'application/pdf'; | ||
export const extension = 'pdf'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import { mimeType } from './encoder-meta'; | ||
import { canvasEncode } from '../../lib/util'; | ||
import { canvasEncodeTest } from '../generic/util'; | ||
|
||
export interface EncodeOptions { } | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-pdf'; | ||
export const label = 'Browser PDF'; | ||
export const mimeType = 'application/pdf'; | ||
export const extension = 'pdf'; | ||
export const defaultOptions: EncodeOptions = {}; | ||
export const featureTest = () => canvasEncodeTest(mimeType); | ||
|
||
export function encode(data: ImageData, options: EncodeOptions) { | ||
export function encode(data: ImageData) { | ||
return canvasEncode(data, mimeType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface EncodeOptions {} | ||
export interface EncoderState { type: typeof type; options: EncodeOptions; } | ||
|
||
export const type = 'browser-png'; | ||
export const label = 'Browser PNG'; | ||
export const mimeType = 'image/png'; | ||
export const extension = 'png'; | ||
export const defaultOptions: EncodeOptions = {}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ah good call splitting out the metadata, that helps resolve some oddities with worker/noworker module loading I was lamenting.