forked from external-repos/squoosh
It finally compiles
This commit is contained in:
@@ -20,5 +20,6 @@ $(filter dec/%,$(OUT_JS)): dec/mozjpeg_dec.cpp
|
||||
-s ENVIRONMENT=$(ENVIRONMENT) \
|
||||
-s EXPORT_ES6=1 \
|
||||
-o $@ \
|
||||
-ljpeg \
|
||||
${MOZJPEG}/lib/libjpeg.a \
|
||||
${MOZJPEG}/lib/rdswitch.o \
|
||||
$+
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
#include "jconfig.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
37
codecs/mozjpeg/enc/mozjpeg_enc.d.ts
vendored
37
codecs/mozjpeg/enc/mozjpeg_enc.d.ts
vendored
@@ -1,37 +0,0 @@
|
||||
export const enum MozJpegColorSpace {
|
||||
GRAYSCALE = 1,
|
||||
RGB,
|
||||
YCbCr,
|
||||
}
|
||||
|
||||
export interface EncodeOptions {
|
||||
quality: number;
|
||||
baseline: boolean;
|
||||
arithmetic: boolean;
|
||||
progressive: boolean;
|
||||
optimize_coding: boolean;
|
||||
smoothing: number;
|
||||
color_space: MozJpegColorSpace;
|
||||
quant_table: number;
|
||||
trellis_multipass: boolean;
|
||||
trellis_opt_zero: boolean;
|
||||
trellis_opt_table: boolean;
|
||||
trellis_loops: number;
|
||||
auto_subsample: boolean;
|
||||
chroma_subsample: number;
|
||||
separate_chroma_quality: boolean;
|
||||
chroma_quality: number;
|
||||
}
|
||||
|
||||
export interface MozJPEGModule extends EmscriptenWasm.Module {
|
||||
encode(
|
||||
data: BufferSource,
|
||||
width: number,
|
||||
height: number,
|
||||
options: EncodeOptions,
|
||||
): Uint8Array;
|
||||
}
|
||||
|
||||
declare var moduleFactory: EmscriptenWasm.ModuleFactory<MozJPEGModule>;
|
||||
|
||||
export default moduleFactory;
|
||||
16
codecs/mozjpeg/enc/mozjpeg_enc.js
generated
16
codecs/mozjpeg/enc/mozjpeg_enc.js
generated
File diff suppressed because one or more lines are too long
Binary file not shown.
16
codecs/mozjpeg/enc/mozjpeg_node_enc.js
generated
16
codecs/mozjpeg/enc/mozjpeg_node_enc.js
generated
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -33,7 +33,7 @@
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
# cp
|
||||
cp enc/*.{wasm,js} $out
|
||||
'';
|
||||
};
|
||||
mozjpeg = stdenv.mkDerivation {
|
||||
@@ -62,10 +62,12 @@
|
||||
'';
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
emmake make V=1 -j$(nproc) --trace libjpeg.la
|
||||
emmake make V=1 -j$(nproc) --trace
|
||||
'';
|
||||
installPhase = ''
|
||||
make install-includeHEADERS install-libLTLIBRARIES
|
||||
make install
|
||||
cp *.h $out/include
|
||||
cp rdswitch.o $out/lib
|
||||
'';
|
||||
dontFixup = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user