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
parent 2f8eb3534e
commit 1e88f9ff71
5 changed files with 4 additions and 4 deletions

View File

@ -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="));

View File

@ -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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -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.