forked from external-repos/squoosh
Adding native encoders (#71)
* Adding browser png * Adding native JPEG & file size output * Removing log * Fixing blob typing * Fix timing issue
This commit is contained in:
@@ -1,35 +1,3 @@
|
||||
import { h, Component } from 'preact';
|
||||
import { EncodeOptions } from './encoder';
|
||||
import { bind } from '../../lib/util';
|
||||
import qualityOption from '../generic/quality-option';
|
||||
|
||||
type Props = {
|
||||
options: EncodeOptions,
|
||||
onChange(newOptions: EncodeOptions): void
|
||||
};
|
||||
|
||||
export default class MozJpegCodecOptions extends Component<Props, {}> {
|
||||
@bind
|
||||
onChange(event: Event) {
|
||||
const el = event.currentTarget as HTMLInputElement;
|
||||
this.props.onChange({ quality: Number(el.value) });
|
||||
}
|
||||
|
||||
render({ options }: Props) {
|
||||
return (
|
||||
<div>
|
||||
<label>
|
||||
Quality:
|
||||
<input
|
||||
name="quality"
|
||||
type="range"
|
||||
min="1"
|
||||
max="100"
|
||||
step="1"
|
||||
value={'' + options.quality}
|
||||
onChange={this.onChange}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
export default qualityOption();
|
||||
|
||||
Reference in New Issue
Block a user