Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow configuration of JPEG quality #198

Closed
artemp opened this Issue · 4 comments

1 participant

@artemp
Owner

No description provided.

@artemp
Owner

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

@artemp
Owner

[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
Owner

[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
Owner

[springmeyer] applied in r1078 and docstring updated in r1082

@artemp artemp closed this
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.