Skip to content

Allow configuration of JPEG quality #198

Closed
artemp opened this Issue Oct 11, 2011 · 4 comments

1 participant

@artemp
Mapnik member
artemp commented Oct 11, 2011

No description provided.

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] Hardcoded at 85 right now here: http://trac.mapnik.org/browser/trunk/src/image_util.cpp#L48

@artemp
Mapnik member
artemp commented Oct 11, 2011

[Dennis] The following patch resolves this issue. It does not break C++ API or Python bindings.

Right now JPEG files are saved with a line in C++ like:
save_to_file(buf.data(),str.str(),"jpeg");

Similar to png256 one can add a suffix to "jpeg" specifying the quality between 0 and 100. If the suffix is anything different from that an exception is thrown specifying the problem (either 'out of bounds' or 'not a number'). Not adding a suffix sets quality to 85 as before.

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] Dennis, great, thanks for this addition.

I've marked this as 'design decision needed' so others can take a look and also 'needs documentation', as before we apply we will also need to update the python docstrings here:

http://trac.mapnik.org/browser/trunk/bindings/python/mapnik_python.cpp#L301

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] applied in r1078 and docstring updated in r1082

@artemp artemp closed this Oct 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.