Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output format: add a AGG/MIXED pseudo driver. #5296

Merged
merged 4 commits into from Jul 7, 2016

Conversation

rouault
Copy link
Contributor

@rouault rouault commented Jun 26, 2016

Implementing https://lists.osgeo.org/pipermail/mapserver-dev/2016-June/thread.html#14878

This driver redirects to a concrete driver when the image
has non-opaque pixels, and to another one when the image
is fully opaque.

Requires to define TRANSPARENT_FORMAT and OPAQUE_FORMAT
FORMAT_OPTION on OUTPUTFORMATs that instanciate that
driver. Those underlying formats can be AGG/PNG, AGG/JPEG
or a GDAL/ one (anyone that uses AGG/ for rendering)

Two predefined formats image/jpeg-png and image/jpeg-png8
are added.

Example of custom mixed formats:

OUTPUTFORMAT
  NAME jpeg_low
  MIMETYPE "image/jpeg; quality=50"
  DRIVER AGG/JPEG
  IMAGEMODE RGB
  FORMATOPTION "QUALITY=50"
END

OUTPUTFORMAT
  NAME jpeg_low_png
  MIMETYPE "image/jpeg_low-png"
  DRIVER AGG/MIXED
  FORMATOPTION "TRANSPARENT_FORMAT=png"
  FORMATOPTION "OPAQUE_FORMAT=jpeg_low"
END

OUTPUTFORMAT
  NAME jpeg_high
  MIMETYPE "image/jpeg; quality=99"
  DRIVER AGG/JPEG
  IMAGEMODE RGB
  FORMATOPTION "QUALITY=99"
END

OUTPUTFORMAT
  NAME jpeg_high_png8
  MIMETYPE "image/jpeg_high-png8"
  DRIVER AGG/MIXED
  FORMATOPTION "TRANSPARENT_FORMAT=png8"
  FORMATOPTION "OPAQUE_FORMAT=jpeg_high"
END

This driver redirects to a concrete driver when the image
has non-opaque pixels, and to another one when the image
is fully opaque.

Requires to define TRANSPARENT_FORMAT and OPAQUE_FORMAT
FORMAT_OPTION on OUTPUTFORMATs that instanciate that
driver. Those underlying formats can be AGG/PNG, AGG/JPEG
or a GDAL/ one (anyone that uses AGG/ for rendering)

Two predefined formats image/jpeg-png and image/jpeg-png8
are added.

Example of custom mixed formats:

    OUTPUTFORMAT
      NAME jpeg_low
      MIMETYPE "image/jpeg; quality=50"
      DRIVER AGG/JPEG
      IMAGEMODE RGB
      FORMATOPTION "QUALITY=50"
    END

    OUTPUTFORMAT
      NAME jpeg_low_png
      MIMETYPE "image/jpeg_low-png"
      DRIVER AGG/MIXED
      FORMATOPTION "TRANSPARENT_FORMAT=png"
      FORMATOPTION "OPAQUE_FORMAT=jpeg_low"
    END

    OUTPUTFORMAT
      NAME jpeg_high
      MIMETYPE "image/jpeg; quality=99"
      DRIVER AGG/JPEG
      IMAGEMODE RGB
      FORMATOPTION "QUALITY=99"
    END

    OUTPUTFORMAT
      NAME jpeg_high_png8
      MIMETYPE "image/jpeg_high-png8"
      DRIVER AGG/MIXED
      FORMATOPTION "TRANSPARENT_FORMAT=png8"
      FORMATOPTION "OPAQUE_FORMAT=jpeg_high"
    END
@tbonfort
Copy link
Member

LGTM
👍 once the tests are updated to reference the new default mimetypes

@rouault
Copy link
Contributor Author

rouault commented Jun 29, 2016

Oh, another thing is the naming "AGG/MIXED" which doesn't reflect that GDAL drivers can actually be used as TRANSPARENT_FORMAT or OPAQUE_FORMAT. But perhaps this can be adressed by a note in the documentation.

@rouault rouault merged commit 85ab097 into MapServer:master Jul 7, 2016
rouault added a commit to MapServer/MapServer-documentation that referenced this pull request Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants