Bug 444898 - JPEG writer uses poor quality default options for compression. r=tor+dolske, sr=pavlov

This commit is contained in:
rsx11m 2009-01-16 15:16:32 +01:00
Родитель 85a24efb89
Коммит 4949ee2287
5 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -106,7 +106,7 @@ NS_IMETHODIMP nsJPEGEncoder::InitFromData(const PRUint8* aData,
return NS_ERROR_ALREADY_INITIALIZED;
// options: we only have one option so this is easy
int quality = 50;
int quality = 92;
if (aOutputOptions.Length() > 0) {
// have options string
const nsString qualityPrefix(NS_LITERAL_STRING("quality="));

Просмотреть файл

@ -88,7 +88,7 @@ interface imgIEncoder : nsIInputStream
// JPEG:
// -----
//
// quality=# -- default: "50"
// quality=# -- default: "92"
// Quality of compression, 0-100 (worst-best).
// Quality >= 90 prevents down-sampling of the color channels.

Двоичные данные
modules/libpr0n/test/unit/image1png16x16.jpg

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 733 B

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
modules/libpr0n/test/unit/image1png64x64.jpg

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.6 KiB

После

Ширина:  |  Высота:  |  Размер: 4.4 KiB

Просмотреть файл

@ -172,7 +172,7 @@ var encodedBytes = streamToArray(istream);
var refName = "image1png16x16.jpg";
var refFile = do_get_file(TESTDIR + refName);
istream = getFileInputStream(refFile);
do_check_eq(istream.available(), 733);
do_check_eq(istream.available(), 1081);
var referenceBytes = streamToArray(istream);
// compare the encoder's output to the reference file.
@ -191,7 +191,7 @@ encodedBytes = streamToArray(istream);
refName = "image1png64x64.jpg";
refFile = do_get_file(TESTDIR + refName);
istream = getFileInputStream(refFile);
do_check_eq(istream.available(), 1593);
do_check_eq(istream.available(), 4493);
referenceBytes = streamToArray(istream);
// compare the encoder's output to the reference file.