Ticket #198 (closed enhancement: fixed)

Opened 18 months ago

Last modified 16 months ago

Allow configuration of JPEG quality

Reported by: springmeyer Owned by: artem
Priority: normal Milestone: 0.6.1
Component: Agg Renderer Version: 0.5.1
Severity: Normal Keywords:
Cc: luxen@… Patch Needs Improvement: no
Needs Docmentation: yes Has Patch?: yes
Design Decision Needed: yes

Description


Attachments

image_util_cpp_jpeg_quality.diff (2.2 kB) - added by Dennis 16 months ago.
image_util_hpp_jpeg_quality.diff (339 bytes) - added by Dennis 16 months ago.

Change History

Changed 18 months ago by springmeyer

Changed 16 months ago by Dennis

Changed 16 months ago by Dennis

  • cc luxen@… added

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<ImageData?32>(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.

Changed 16 months ago by Dennis

Changed 16 months ago by springmeyer

  • has_patch set
  • milestone changed from 1.0.0 to 0.6.1
  • need_documentation set
  • design_decision_needed set

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

Changed 16 months ago by springmeyer

  • status changed from new to closed
  • resolution set to fixed

applied in r1078 and docstring updated in r1082

Note: See TracTickets for help on using tickets.