Compare commits

...

3 Commits

Author SHA1 Message Date
593ad62cbb 1.2.3 2018-12-10 12:25:27 +00:00
a625a76e9e Fixed blank text-fields with dark browser theme (#365)
When using dark browser themes the text-fields' text-color becomes white, so the text in those white background text-fields is unreadable.

Patched text-color so that it now is readable.
2018-12-10 12:24:12 +00:00
c2a305304b Rotation optimise. Fixes #362 (#363)
* Move early exit for no-rotation.

* lol this was meant to be 10 seconds.
2018-12-09 07:11:11 +00:00
6 changed files with 12 additions and 9 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "squoosh",
"version": "1.2.2",
"version": "1.2.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "squoosh",
"version": "1.2.2",
"version": "1.2.3",
"license": "apache-2.0",
"scripts": {
"start": "webpack-dev-server --host 0.0.0.0 --hot",

View File

@ -20,7 +20,7 @@ import * as browserPDF from './browser-pdf/encoder';
type ProcessorWorkerApi = import('./processor-worker').ProcessorWorkerApi;
/** How long the worker should be idle before terminating. */
const workerTimeout = 1000;
const workerTimeout = 10000;
interface ProcessingJobOptions {
needsWorker?: boolean;

View File

@ -4,10 +4,6 @@ const bpp = 4;
export function rotate(data: ImageData, opts: RotateOptions): ImageData {
const { rotate } = opts;
// Early exit if there's no transform.
if (rotate === 0) return data;
const flipDimensions = rotate % 180 !== 0;
const { width: inputWidth, height: inputHeight } = data;
const outputWidth = flipDimensions ? inputHeight : inputWidth;

View File

@ -43,6 +43,7 @@ $horizontalPadding: 15px;
.text-field {
background: #fff;
color: #000;
font: inherit;
border: none;
padding: 2px 0 2px 10px;

View File

@ -85,12 +85,18 @@ interface UpdateImageOptions {
skipPreprocessing?: boolean;
}
function processInput(
async function processInput(
data: ImageData,
inputProcessData: InputProcessorState,
processor: Processor,
) {
return processor.rotate(data, inputProcessData.rotate);
let processedData = data;
if (inputProcessData.rotate.rotate !== 0) {
processedData = await processor.rotate(processedData, inputProcessData.rotate);
}
return processedData;
}
async function preprocessImage(