mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 444898 – JPEG writer uses poor quality default options for compression. r=tor, sr=pavlov
This commit is contained in:
parent
7708e3dc71
commit
4c06ce90fa
@ -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="));
|
||||
@ -154,6 +154,13 @@ NS_IMETHODIMP nsJPEGEncoder::InitFromData(const PRUint8* aData,
|
||||
|
||||
jpeg_set_defaults(&cinfo);
|
||||
jpeg_set_quality(&cinfo, quality, 1); // quality here is 0-100
|
||||
if (quality >= 90) {
|
||||
int i;
|
||||
for (i=0; i < MAX_COMPONENTS; i++) {
|
||||
cinfo.comp_info[i].h_samp_factor=1;
|
||||
cinfo.comp_info[i].v_samp_factor=1;
|
||||
}
|
||||
}
|
||||
|
||||
// set up the destination manager
|
||||
jpeg_destination_mgr destmgr;
|
||||
|
@ -88,8 +88,9 @@ 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.
|
||||
|
||||
|
||||
// Possible values for input format (note that not all image formats
|
||||
|
Loading…
Reference in New Issue
Block a user