@
Reign 请作者先解释一下自己直接使用 MozJPEG (使用 emscripten 转编译到 JavaScript ),违反 BSD 协议不写 Copyright、声称「独特且强悍的 JavaScript 算法」并拿来收费的行为?
证据 1,mozjpeg 包含 debug 参数,作者连改改都懒,于是 picdiet.js 也可以直接输出 mozjpeg 的 debug 信息
> picdiet([], { debug: 1 })
Error: No output: mozjpeg version 3.1 (build 20160620)Copyright (C) 1991-2012 Thomas G. Lane, Guido VollbedingCopyright (C) 1999-2006 MIYASAKA MasaruCopyright (C) 2009 Pierre Ossman for Cendio ABCopyright (C) 2009-2014 D. R. CommanderCopyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)Copyright (C) 2014 Mozilla CorporationCopyright (C) 2013-2014 MIPS Technologies, Inc.Copyright (C) 2013 Linaro LimitedEmulating The Independent JPEG Group's software, version 6b 27-Mar-1998./this.program: only one input fileusage: ./this.program [switches] [inputfile]Switches (names may be abbreviated): -quality N[,...] Compression quality (0..100; 5-95 is useful range) -grayscale Create monochrome JPEG file -rgb Create RGB JPEG file -optimize Optimize Huffman table (smaller file, but slow compression, enabled by default) -progressive .......
证据 2,代码中入口函数「 var cjpeg = ……」这是使用 emscripten 对
https://github.com/mozilla/mozjpeg/blob/master/cjpeg.c 转化的痕迹,作者同样也是懒得修改…
证据 3,可以直接对比 picdiet.js 代码与其他人用 emscripten 编译 mozjpeg 产生文件的结果,例如这个项目
https://github.com/as-com/mozjpeg-js 可以发现几乎所有的浮点 magic number 都是一致的,以及一致的 magic number 所处的函数结构和流程也都是一模一样( ps:后者使用了较新的编译工具链有循环展开,因此代码结构不完全一致)
https://imgur.com/pQd6OSzhttps://imgur.com/TC6Bcqlhttps://imgur.com/jGiA41L